SetCursorPos(x,y:integer);

GetCursorPos(lpPoint:TPoint);

ClipCursor(lpRect:PRect);

Screen.Width,Screen.Height;//uses Forms;

 

begin
mouse_event(MOUSEEVENTF_MOVE, 100, 100, 0, 0); //模拟鼠标移动
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
SetCursorPos(10, 10);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //模拟左键单击
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
SetCursorPos(200, 200);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //模拟左键双击

end;

procedure TForm1.Button4Click(Sender: TObject);
begin
SetCursorPos(200, 200);
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); //模拟右键单击
end;