|
-
Nov 30th, 1999, 01:48 AM
#3
Addicted Member
Also, as Aaron showed me in a question I posted earlier, the GerCursorPos API will return the position of the cursor in pixels with reference to the top left corner of the screen. Then, although I may be wrong, I've only been experimenting for a couple hours with this, you can multiply the result by 15 to get a value in twips.
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Form_Load()
Timer1.enabled = True
Timer1.interval = 100
End Sub
Private Sub Timer1_Timer()
Dim tPos as POINTAPI
Call GetCursorPos(tPos)
Label1.Caption = "Pixels: " & tPos.x & "," & tPos.y
Label2.Caption = "Twips: " & Str(tPos.x * 15) & "," & Str(tPos.y * 15)
End Sub
This, as far as my own experiments have me thinking, will have the two labels showing the mouse's current position, one in pixels and one in twips.
Hope that is of some help to ya.
This
------------------
Micah Carrick
Ordinary joe with a new found passion for code.
http://micah.carrick.com
[email protected]
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
|