B
biku
Unregistered / Unconfirmed
GUEST, unregistred user!
用下面的函数能给任意窗口画边框,但如何能让这个边框保持恒久呢?
function HighlightWindow(pl_hwnd: Hwnd;cor:tColor):bool;
var
ll_hDC : HDC;
lu_RECT : TRECT;
ll_Pen : HPEN;
begin
GetWindowRect(pl_hWnd,lu_RECT);
ll_hDC := GetWindowDC(pl_hWnd);
SetROP2(ll_hDC, R2_NOTXORPEN);
ll_Pen := CreatePen(ps_solid, 2, cor);
SelectObject(ll_hDC, ll_Pen);
SelectObject(ll_hDC, GetStockObject(HOLLOW_BRUSH));
Rectangle(ll_hDC, 0, 0, lu_RECT.Right - lu_RECT.Left, lu_RECT.Bottom - lu_RECT.Top);
DeleteObject(ll_Pen);
ReleaseDC(pl_hWnd, ll_hDC);
result:=true;
end;
function HighlightWindow(pl_hwnd: Hwnd;cor:tColor):bool;
var
ll_hDC : HDC;
lu_RECT : TRECT;
ll_Pen : HPEN;
begin
GetWindowRect(pl_hWnd,lu_RECT);
ll_hDC := GetWindowDC(pl_hWnd);
SetROP2(ll_hDC, R2_NOTXORPEN);
ll_Pen := CreatePen(ps_solid, 2, cor);
SelectObject(ll_hDC, ll_Pen);
SelectObject(ll_hDC, GetStockObject(HOLLOW_BRUSH));
Rectangle(ll_hDC, 0, 0, lu_RECT.Right - lu_RECT.Left, lu_RECT.Bottom - lu_RECT.Top);
DeleteObject(ll_Pen);
ReleaseDC(pl_hWnd, ll_hDC);
result:=true;
end;