Mouse - move para um controle |
Top Previous Next |
procedure MoveMouseToControl(const Control: TControl); Var nX, nY: Integer; rRect : TRect; begin rRect.TopLeft := Control.ClientToScreen( Control.ClientRect.TopLeft ); rRect.BottomRight := Control.ClientToScreen( Control.ClientRect.BottomRight ); nX := rRect.Left + Trunc( (rRect.Right - rRect.Left) / 2 ); nY := rRect.Top + Trunc( (rRect.Bottom - rRect.Top) / 2 ); SetCursorPos( nX, nY ); end; |