Click to See Complete Forum and Search --> : postion of clicked mouse
yifeipan
Nov 26th, 1999, 11:05 AM
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.
Aaron Young
Nov 26th, 1999, 11:33 AM
Place in a Form with a Timer Control:
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
yifeipan
Nov 26th, 1999, 09:33 PM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.