procedure TForm1.Button1Click(Sender: TObject);
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;