各位大哥帮帮小弟呀,帮我看看为什么mouse_event不起点击作用

[复制链接]
查看11 | 回复0 | 2008-3-26 18:25:04 | 显示全部楼层 |阅读模式
各位大哥帮帮小弟呀,帮我看看为什么mouse_event不起点击作用 悬赏分:20 - 离问题结束还有 12 天 19 小时Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up Private Const KEYEVENTF_KEYUP = &H2 Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Private Declare Sub mouse_event Lib "user32" (dwFlags As String, dx As Long, dy As Long, dwData As Long, dwExtralnfo As Long) Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Declare Function GetMessageExtraInfo Lib "user32" () As Long //激活时钟 Private Sub Command1_Click() Timer1.Enabled = True Timer2.Enabled = True End Sub Private Sub Timer1_Timer() Dim bia As POINTAPI Dim d As POINTAPI Dim lt As Single Dim hwnd, this As Long ' 储存 FindWindow 函数返回的句柄 hwnd = FindWindow(vbNullString, "【魔域】") ' 取得进程标识符 Call GetWindowThreadProcessId(hwnd, this) '只要把Windows Media Player换成游戏的名称就可了! If hwnd = 0 Then Label1.Caption = "游戏未运行" Else Label1.Caption = "游戏已运行" End If GetCursorPos bia If i > 20 Then i = 0 i = i + 1 Else i = i + 1 End If Select Case i Case 1: Call SetCursorPos(150, 120) Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) Call mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) Case 2: Call SetCursorPos(150
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行