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!