this slowpoke moves

Create Ball Form to Mouse

uses WinTypes, WinProcs

//

procedure TForm1.Timer1Timer(Sender: TObject);
var
 dx, dy, i : integer;
 point : Tpoint;
begin
 GetCursorPos(point);
 Dx := point.X-form1.Left;
 dx := round(19*dx/20);
 Form1.Left:=point.X-dx;

 Dy:=point.y-form1.top;
 dy:=round(19*dy/20);
 Form1.top:=point.y-dy;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
 R: HRgn;
 hMenuHandle: HMENU;
begin
 r := CreateEllipticRgn(0,0,50,50);
 SetWindowRgn(Handle, R, True);
end;

procedure TForm1.FormDblClick(Sender: TObject);
begin
 Close;
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate