~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.FormCreate(Sender: TObject) ;
var r : TRect;
begin
//it would be good idea to move the
//mouse inside the form before restriction
r := BoundsRect;
ClipCursor(@R) ;
end;
procedure TForm1.FormClick(Sender: TObject) ;
begin
//always be sure to release the cursor
ClipCursor(nil) ;
end;