procedure TForm1.Button1Click(Sender: TObject);
var
Rgn,hInRgn,hOutRgn:hrgn;
i:integer;
Rc:Trect;
begin
i:=0;
GetWindowRect(handle,Rc);
hOutRgn:=CreateRectRgn(0,0,Rc.Right-Rc.Left+1,Rc.Bottom-Rc.Top+1);
try
while (i<width div 2) do begin
inc(i);
hInRgn:=CreateRectRgn(Width div 2-i,height div 2 -i,Width div 2+i,height div 2 +i);
try
CombineRgn(hInRgn,hInRgn,hOutRgn,Rgn_And);
SetWindowRgn(Handle,hInRgn,True);
finally
DeleteObject(hInRgn);
end;
end;
finally
DeleteObject(hOutRgn);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
width := 1;
Height:=1;
Left:=screen.Width div 2;
top:=screen.Height div 2;
Left:=Left-width div 2;
top:=top-height div 2;
while ((Left>250) and (Top>200)) do begin
Width:=Width+4;
Height:=Height+4;
Left:=Left-2;
Top:=Top-2;
end;
end;