-
Nov 26th, 1999, 12:05 PM
#1
Thread Starter
New Member
first thanks those answered my questions before. I learned from this board for how to
get mouse position.
My new question is how to write codes that
shows mouse position whenever mouse is
clicked only. ie., does not show whennot clicked.
Thanks in advance.
-
Nov 26th, 1999, 12:33 PM
#2
Place in a Form with a Timer Control:
Code:
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Sub Form_Load()
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim tPOINT As POINTAPI
If GetAsyncKeyState(vbLeftButton) Then
Call GetCursorPos(tPOINT)
Caption = tPOINT.x & ":" & tPOINT.y
End If
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
-
Nov 26th, 1999, 10:33 PM
#3
Thread Starter
New Member
Thanks for the eode, it works great.
I hope you can help me a little bit further
I also want to display positions of two
clicked mouse. say display first clicked positon, then display second clicked positon
in a form with first one still displayed,of
course second as well.
I could not figure out the "trick" doing
it. If you know please me know
Thanks lot in advance
Yifei Pan
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
|