![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2005
Posts: 11
Rep Power: 0
![]() |
MouseX and MouseY
How do you store MouseX and MouseY positions in a variable?
|
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Simple:
Dim x As Integer, y As Integer x = MouseX y = MouseY |
|
|
|
|
|
#3 |
|
Expert Programmer
|
I think he meant how do you get the mouse position rather than "how do you assign variables"!
Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINTAPI) As Long
Type POINTAPI
x As Long
y As Long
End Type
Sub Test()
Dim mypos as POINTAPI
if GetCursorPos(mypos)>0 then
msgbox "Mouse at " & mypos.x & "," & mypos.y
end if
end sub |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|