我想知道鼠标移动代码和键盘的代码
例如鼠标要移动 100,100并且鼠标左键单击,这个代码怎么弄?
键盘自动按按扭!
我想做一个游戏自动加血的外挂
我的思路是这样的(但是我完全不知道这些代码!)
检测坐标100,100是否为黑色,如果是黑色,则键盘按1,如果不是黑色,则无任何操作!结束
还有代码请高手给我留下来
鼠标右键单击
鼠标右键双击
鼠标左键单击
鼠标左键双击
鼠标按住。。。。。。。。。。。。。。。等等
还有键盘
自动按1
自动按2
自动按3。。。。。。。。。。。。。等等
是不是还有什么按键虚拟码?
后台操作代码等等,如果我非常满意,我给加300分!!!
想写你说的那个外挂,必须了解以下api的使用方法,这是最基本的,你慢慢研究吧
移动和按下鼠标用:
Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
模拟按钮用:
Public Declare Sub keybd_event Lib "user32" Alias "keybd_event" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
后台发送键鼠消息用:
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
或
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
获取屏幕上某点的颜色用:
Public Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
获取窗体句柄用:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long