N
ndust
Unregistered / Unconfirmed
GUEST, unregistred user!
1.REGION
2.WMWinPosChanging(var Message: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING;
3.WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND;
4.Rect(0, 0, Screen.Width, Screen.Height);
procedure TForm1.FormCreate(Sender: TObject);
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;
能把这个程序解释一下吗?
2.WMWinPosChanging(var Message: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING;
3.WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND;
4.Rect(0, 0, Screen.Width, Screen.Height);
procedure TForm1.FormCreate(Sender: TObject);
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;
能把这个程序解释一下吗?