重大问题,生成exe就不能运行
在vb模式可以测试运行无误,生成exe后就不能正常运行主要是坐标函数问题,因为y轴我用的是text
不知道为什么不行 谁能告诉我
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Integer, ByVal Y As Integer) As Boolean
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Const MOUSEEVENTF_RIGHTDOWN = &H8
Private Const MOUSEEVENTF_RIGHTUP = &H10
'热键声明部分
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI '定义点(Point)结构
y2 As Long '点在Y坐标(纵坐标)上的坐标值
End Type
Private Sub Timer1_Timer()
SetCursorPos 819, Int(y2) * 16 + 388
mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0
Sleep 40
mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
Sleep 40
SetCursorPos 700, Int(y2) * 16 + 464
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
Sleep 40
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
Private Sub Timer2_Timer()
If GetAsyncKeyState(vbKeyF2) Then
Timer1.Enabled = True
End If
If GetAsyncKeyState(vbKeyF5) Then
Timer1.Enabled = False
End If
End Sub
Private Sub tiren_Click()
Form2.Show
Unload Form3
End Sub
Private Sub y2_Change()
End Sub
Private Sub yingdong_Timer()
If zimu.SelStart < Len(zimu.Text) - 3 Then
zimu.SelStart = zimu.SelStart + 1
zimu.SelLength = 1
Else
zimu.SelStart = 0
zimu.SelLength = 1
End If
End Sub
---------------------------
这是我的代码,中间有一些无关的代码就没贴出来了。