Is there code in VB to be able to find screen cootdinates? Or does anyone know a way to find them.
I want VB to place the mouse at a certain point on the screen but have no idea where the coords are or how to find them.
Thanks!
Printable View
Is there code in VB to be able to find screen cootdinates? Or does anyone know a way to find them.
I want VB to place the mouse at a certain point on the screen but have no idea where the coords are or how to find them.
Thanks!
Quote:
Originally Posted by Malkavian
I'm not quite shure what you want, the GetCursorPos API function can get the position of the cursor on the screen.
Can you define what it is you want to do more clearily?
Cheers,
RyanJ
If you are talking bout just your form, be sure your Scalemode = 3 - Pixels ;)
to get the cursor position on the screen use this
VB Code:
Option Explicit Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Type POINTAPI x As Long y As Long End Type Private Sub Timer1_Timer() Dim POS As Long Dim Cursor As POINTAPI POS = GetCursorPos(Cursor) Label1.Caption = "X = " & Cursor.x & " " & "Y = " & Cursor.y End Sub
-Sir Loin
Got it thanks all.