(CodeLib-Manager)
Registriert seit: 10. Jun 2002
4.648 Beiträge
Delphi XE Professional
|
Re: Suche Funktion um Fenster oder Controls zu selektieren
4. Okt 2008, 07:55
Delphi-Quellcode:
procedure FrameWindow(Wnd: HWND);
var
dc: HDC;
rc: TRect;
hOldPen, hOldBrush: HBrush;
begin
if GetWindowRect(Wnd, rc) then
begin
dc := GetWindowDC(Wnd);
if dc <> 0 then
try
SetROP2( dc, R2_NOTXORPEN);
hOldBrush := SelectObject( dc, GetStockObject(NULL_BRUSH));
hOldPen := SelectObject( dc, CreatePen(PS_DASHDOT, 2, $00));
with rc do
Rectangle( dc, 1, 1, Right - Left, Bottom - Top);
SelectObject( dc, hOldBrush);
DeleteObject(SelectObject( dc, hOldPen));
finally
ReleaseDC(Wnd, dc);
end;
end;
end;
Thomas
|
|
Zitat
|