如何模拟Mouse双点击桌面上的一个图标?(50分)

  • 主题发起人 主题发起人 dzb
  • 开始时间 开始时间
D

dzb

Unregistered / Unconfirmed
GUEST, unregistred user!
已知图标位置(X,Y), 我已经作如下尝试. 不行.<br><br>&nbsp; &nbsp; SetCursorPos(X,Y);<br>&nbsp; &nbsp;// mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);<br>&nbsp; &nbsp;// mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);<br>&nbsp; &nbsp;<br>&nbsp; &nbsp; SendMessage(Handle,WM_LBUTTONDBLCLK,0,0);<br>or <br>&nbsp; &nbsp; SendMessage(Handle,WM_NCLBUTTONDBLCLK,0,0);<br><br>
 
打开我的电脑:<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>&nbsp; &nbsp;SetCursorPos(25,25);<br>&nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);<br>&nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);<br>&nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);<br>&nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);<br>end;
 
试过了,wjiachun is right.<br>
 
这是模拟双击!<br>用WEB页方式,只要一次!:)<br>还要获取图标的正确位置!<br><br>
 
接受答案了.
 

Similar threads

I
回复
0
查看
605
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
508
import
I
后退
顶部