
JaVa CoDe
Senior Member

Jan 24, 2005, 3:55 AM
Post #1 of 12
(2045 views)
Shortcut
|
Now here we go again this is code that can click at a spot on the resolution co-ordinates its short and easy CODE Private Sub ClickAt(ByVal X As Long, ByVal Y As Long) SetCursorPos X, Y Wait 10 mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 Wait 10 mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 End Sub Examples: ClickAt 600, 425 Now i Will show you how to make sure there at a certain resolution CODE Private Sub Form_Load() Dim w As Long, h As Long w = ScaleX(Screen.Width, vbTwips, vbPixels) h = ScaleY(Screen.Height, vbTwips, vbPixels) If w < 1024 Or h < 768 Then MsgBox "You must be in 1024x768 mode to run this program!" & vbCrLf & _ "You're currently in " & w & "x" & h, vbCritical Unload Me End If End Sub plus heres how to tell where a co-ordinate is by puting your mouse somewhere CODE Private Sub tmrMouse_Timer() Dim p As POINTAPI GetCursorPos p Text9.Text = p.X & "," & p.Y End Sub I hope this little tutorial helped you in any way
My train of thought has been delayed.
|