Question:
How to Confine The Mouse?

Answer:
procedure TForm1.Button1Click(Sender: TObject);
var
Rect: TRect;
begin
Rect.Left := Left;
Rect.Top := Top;
Rect.Right := Left + Width;
Rect.Bottom := Top + Height;
ClipCursor(@Rect);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ClipCursor(nil);
end;




CLICK TO REGISTER