Size.cx := GetSystemMetrics(SM_CXDLGFRAME);
Size.cy := Size.cx;
// Outline zeichnen
DC := GetDCEx(GetDesktopWindow, 0,
DCX_LOCKWINDOWUPDATE
or DCX_CACHE
or DCX_WINDOW);
TB2Common.DrawHalftoneInvertRect(
DC, @OutlineRect,
nil, Size, Size);
ReleaseDC(GetDesktopWindow,
DC);
// ...
// Outline löschen
DC := GetDCEx(GetDesktopWindow, 0,
DCX_LOCKWINDOWUPDATE
or DCX_CACHE
or DCX_WINDOW);
SetRectEmpty(R);
TB2Common.DrawHalftoneInvertRect(
DC, @R, @FLastOutlineRect, Size, Size);
ReleaseDC(GetDesktopWindow,
DC);
// TB2Common.pas
procedure DrawHalftoneInvertRect(
const DC: HDC;
const NewRect, OldRect: PRect;
const NewSize, OldSize: TSize);
var
Brush: HBRUSH;
begin
Brush := CreateHalftoneBrush;
try
DrawInvertRect(
DC, NewRect, OldRect, NewSize, OldSize, Brush, Brush);
finally
DeleteObject(Brush);
end;
end;