var
FullRgn, ClientRgn, CtlRgn: THandle;
procedure MakeTransparent(
Handle: HWND);
var
NextChild: HWND; CtlX, CtlY: Integer; R: TRect;
begin
GetWindowRect(
Handle, R);
MapWindowPoints(HWND_DESKTOP,
Handle, R, 2);
with R
do begin
FullRgn := CreateRectRgn(Left, Top, Right, Bottom);
ClientRgn := CreateRectRgn(Left, Top, Right, Bottom);
CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
end;
NextChild := GetTopWindow(
Handle);
while NextChild > 0
do
begin
GetWindowRect(NextChild, R);
MapWindowPoints(HWND_DESKTOP,
Handle, R, 2);
if NextChild > 0
then with R
do
begin
CtlX := Left;
CtlY := Top;
CtlRgn := CreateRectRgn(CtlX, CtlY, CtlX + (Right-Left), CtlY + (Bottom-Top));
CombineRgn(FullRgn, FullRgn, CtlRgn, RGN_OR);
NextChild := GetNextWindow(NextChild, GW_HWNDNEXT);
end;
end;
SetWindowRgn(
Handle, FullRgn, True);
end;
...
begin
...
for i := 0
to length(hTabDlgs) - 1
do begin
SetWindowLong(hTabDlgs[i], GWL_STYLE, DS_CONTROL
or WS_CHILD);
SetParent(hTabDlgs[i], Wnd);
MakeTransparent(hTabDlgs[i]);
...
end;
end;
...