SPECIAL OFFER        Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming!

⤷ Confine mouse

Use ClipCursor function, which allows you to confine mouse moving in some area.

//Confine mouse
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;

// Free mouse
procedure TForm1.Button2Click(Sender: TObject);
begin
  ClipCursor(nil);
end;
More for developers
Databases for Amazon Associates
Amazon Categories
Amazon Nodes