哪位大哥知道怎样模拟键盘和鼠标动作。。。。不是在当前程序中而是在windows下(50分)

  • 主题发起人 主题发起人 .com
  • 开始时间 开始时间
C

.com

Unregistered / Unconfirmed
GUEST, unregistred user!
哪位大哥知道怎样模拟键盘和鼠标动作。。。。不是在当前程序里而是在windows下
 
MOUSE_EVENT;
 
VOID mouse_event(<br>&nbsp; DWORD dwFlags, // flags specifying various motion/click variants<br>&nbsp; DWORD dx, &nbsp; &nbsp; &nbsp;// horizontal mouse position or position change<br>&nbsp; DWORD dy, &nbsp; &nbsp; &nbsp;// vertical mouse position or position change<br>&nbsp; DWORD dwData, &nbsp;// amount of wheel movement<br>&nbsp; DWORD dwExtraInfo <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// 32 bits of application-defined information<br>);<br>&nbsp;<br>VOID keybd_event(<br>&nbsp; BYTE bVk, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // virtual-key code<br>&nbsp; BYTE bScan, &nbsp; &nbsp; &nbsp; &nbsp; // hardware scan code<br>&nbsp; DWORD dwFlags, &nbsp; &nbsp; &nbsp;// flags specifying various function options<br>&nbsp; DWORD dwExtraInfo &nbsp; // additional data associated with keystroke<br>);<br>
 
补充:SetCursorPos 设置鼠标位置
 
有个例子多好啊
 
SetKeyboardState()模拟按下一个键<br>SendKey() 发送另一个按键<br>我用这种方法实现了WIN+F.--查找对话框
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部