Delphi and Kylix

Moderators: pritaeas
Number of threads: 7244
Number of posts: 19051

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Third party overlay? Posted by zorfox on 26 Jan 2011 at 6:50 AM
I'm writing an application to display statistics within a third party window. Applications I've seen that do this show multiple “heads up displays” in each window. I assume the way to do this is to overlay my window over the third party’s window and hide the form but not the components. I have been able to do this using the CombineWindowsRGN. However, I can’t seem to show more than one component at a time since I am using CreateRectRGN. Maybe if I understood CreatePolygonRGN that would be the way to approach this rather than CreateRectRGN? Here is the way I do it for one component, Button1…

var
FullRgn, ClientRgn, ButtonRgn: THandle;
Margin, X, Y: Integer;
begin
Margin := (Width - ClientWidth) div 2;
FullRgn := CreateRectRgn(0, 0, Width, Height) ;
X := Margin;
Y := Height - ClientHeight - Margin;
ClientRgn := CreateRectRgn
(X, Y, X + ClientWidth, Y + ClientHeight) ;
CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF) ;
X := X + Button1.Left;
Y := Y + Button1.Top;
ButtonRgn := CreateRectRgn
(X, Y, X + Button1.Width, Y + Button1.Height) ;
CombineRgn(FullRgn, FullRgn, ButtonRgn, RGN_OR) ;
SetWindowRgn(Handle, FullRgn, True) ;
end;

Regardless it seems like I am approaching this all wrong. Since I need to be able to drag the HUD (components) around the third party window, repainting the window every few milliseconds appears choppy. My other option may be to AlphaBlend the form to 0 but not the components. Again, I see no way to do this since the components are siblings of the form and fade away as well. Setting MyComponent.Parent := nil causes them to disappear for obvious reasons.

I’m at a loss right now and would greatly appreciate any input. I am still using Delphi 7 by the way. Thanks in advance!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.