I have a memory Error!!
what is wrong with this code? When i run it eventually gives me a memory error. Can you Help?
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 Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Const MOUSEEVENTF_LEFTDOWN = &H2 '' left button down
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Public test As Long
Private Sub Form_Load()
Timer1.Interval = 2000
End Sub
Private Sub Timer1_Timer()
''Log in auto
Static intI As Integer
Select Case intI
Case 0
SetCursorPos 294, 458
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
intI = 1
Case 1
SendKeys (Text1 + "{enter}")
intI = 2
Case 2
SendKeys (Text2 + "{enter}")
intI = 3
Case 3
intI = 4
Case 4
SetCursorPos 439, 374
Dim Login As String
Login = GetPixel(test, 439, 374)
If Hex(Login) = "FF" Then
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
intI = 0
Timer1.Enabled = False
Else
End If
End Select
End Sub
Private Sub Timer2_Timer()
Static int1 As Integer
Select Case int1
Case 0
SetCursorPos 527, 185
int1 = 1
Case 1
SetCursorPos 537, 235
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
int1 = 2
Case 2
SetCursorPos 368, 234
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
int1 = 0
End Select
End Sub
Private Sub tmrMage1_Timer()
Dim Color As Long
Dim Vex As Long
test = GetWindowDC(0)
Dim curpos As POINTAPI
Call GetCursorPos(curpos)
Dim Color2 As Long
Color2 = GetPixel(test, 637, 162)
If Hex(Color2) = 846500 Then
Label5.Caption = "Positioned!"
Else
Label5.Caption = "MOVE PAGE!"
End If
Dim Color3 As Long
Color3 = GetPixel(test, 294, 458)
If Hex(Color3) = 947163 And Check1.Value = 1 Then
int1 = 0
Timer1.Enabled = True
Else
End If
If Timer1.Enabled = False And Check2.Value = 1 Then
Timer2.Enabled = True
Else
Timer2.Enabled = False
End If
End Sub
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement