以前问过好几次了。<br><br>模拟鼠标<br><br>鼠标移动(移动量dx,dy)<br>mouse_event(MOUSEEVENTF_MOVE,dx,dy,0,0);<br>鼠标在(x,y)处按下或释放<br>setcursorpos(x,y);<br>mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);<br>mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);<br>mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);<br>mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);<br>鼠标双击由两次按下与释放来模拟<br><br>键盘模拟<br><br>一般虚拟键值(VK_)由KeyDown或keyup事件得到<br>特殊键值<br>Tab--9<br>Shift--16<br>Ctrl--17<br>Alt--18<br>CapsLock--20<br>Esc--27<br>Win--91,92<br>NumLock--144<br>ScrollLock--145<br><br>按下键<br>keybd_event(key,MapVirtualKey(key,0),KEYEVENTF_KEYUP,0);<br>释放键<br>keybd_event(key,MapVirtualKey(key,0),0,0);