Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 19th, 2005, 1:50 PM   #1
Yu Raider
Newbie
 
Join Date: Jan 2005
Posts: 11
Rep Power: 0 Yu Raider is on a distinguished road
MouseX and MouseY

How do you store MouseX and MouseY positions in a variable?
Yu Raider is offline   Reply With Quote
Old Jan 19th, 2005, 2:17 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Simple:
Dim x As Integer, y As Integer

x = MouseX
y = MouseY
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jan 21st, 2005, 11:18 AM   #3
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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
Rory is offline   Reply With Quote
Old Jan 21st, 2005, 11:57 AM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Ah, shush. They should make it clearer :p
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:01 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC