Restored from previous forum. Originally posted by Franco.
Can anybody tell me why this not works? Is something missing?
Structure pt
x.l
y.l
EndStructure
Dim Cursor.pt(8)
GetCursorPos_(Cursor)
xPos$=str(Cursor(0)\x)
yPos$=str(Cursor(4)\y)
MessageRequester("Cursor Position:",xPos$ + " , " + yPos$, 0)
Have a nice day...
Franco
Win API; GetCursorPos
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Mr.Skunk.
Here it is a correction:
Structure pt
x.l
y.l
EndStructure
Cursor.pt
GetCursorPos_(Cursor)
xPos$=str(Cursor\x)
yPos$=str(Cursor\y)
MessageRequester("Cursor Position:",xPos$ + " , " + yPos$, 0)
You don't have to create an array as in your structure x.l and y.l are Long numbers (4 bytes), the space to store the values is already reserved.
Mr Skunk
Mr Skunk's PureBasic Web Page
http://www.skunknet.fr.st
Here it is a correction:
Structure pt
x.l
y.l
EndStructure
Cursor.pt
GetCursorPos_(Cursor)
xPos$=str(Cursor\x)
yPos$=str(Cursor\y)
MessageRequester("Cursor Position:",xPos$ + " , " + yPos$, 0)
You don't have to create an array as in your structure x.l and y.l are Long numbers (4 bytes), the space to store the values is already reserved.
Mr Skunk
Mr Skunk's PureBasic Web Page
http://www.skunknet.fr.st
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm