模拟鼠标点击

I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
鼠标自动点击的例子,模拟鼠标点击 procedure TForm1.Button1Click(Sender: TObject);
var
x,y:integer;
begin
x:= form1.Left+button2.Left+25;
y:= top+button2.Top+27;
SetCursorPos(x,y);
Mouse_Event(MOUSEEVENTF_LEFTDOWN,X,Y,0,0);
Mouse_Event(MOUSEEVENTF_LEFTUP,X,Y,0,0);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
showmessage('fksj');
end;
*************************************
// Set the mouse cursor to position x,y:
SetCursorPos(x, y);
// Simulate the left mouse button down
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
// Simulate the right mouse button down
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
 

Similar threads

I
回复
0
查看
488
import
I
I
回复
0
查看
623
import
I
I
回复
0
查看
462
import
I
I
回复
0
查看
657
import
I
顶部