|
-
Mar 17th, 2001, 07:44 PM
#1
Thread Starter
Addicted Member
Hihi! I'm working on my awesome map editor for my RPG And I'm using GetCursorPos to select the tile that I want to change/edit walkability on. All is well, except I need to know one thing: How do I make the GetCursorPos API have the 0,0 coordinate start at the top left of the picturebox, rather than the top left of the screen?
To understand recursion, one must first understand the concept of recursion.
-
Mar 17th, 2001, 09:29 PM
#2
New Member
......very easy
add:
-picture1
-timer1
to the project
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Sub Timer1_Timer()
Dim pt As POINTAPI
GetCursorPos pt
' Translate into window coordinates.
ScreenToClient Picture1.hwnd, pt
Debug.Print pt.X, pt.Y
End Sub
-
Mar 17th, 2001, 09:58 PM
#3
Thread Starter
Addicted Member
Thanks a lot
To understand recursion, one must first understand the concept of recursion.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|