You can always capture mouse clicks. Some are more work than others.
The easiest case is if the window in question is the form you are writing. There are Form mouse down, mouse up and click events as a part of windows forms.
These events come with mouse event arguments what key is down and the relative cursor location with in the form.
If you are interested in mouse clicks on a system wide basis via the API.
What to you mean by "catch". Do you simply want to do something when some sort of mouse-click event occurs, or do you want to swallow/translate the mouse-clicks
End If End Function You'll have to poll this at intervals and look for whether mouse keys are down.
You can look at the curso position (Another API routine) which gives screen coordinates. You then get to see if the cursor coordinates fall inside the windows of the program.
There will be asynchronous form events that will firs when events occur. They are declared at design time you.
On the left form window find "Form events". The right one will now show you the excutable events which can contain your code you meet your needs.
You can poll the msgproc, and get all the windows events... Or if it's just your application, you can setup on click events and mouse move envets...
What i do (I find generally quicker then polling msgproc), is to setup DirectX - DirectInput for Mouse and Keyboard, and poll the Mouse and Keyboard directly.
Dustin.
not thank you from all people using tools detecting directx use - mainly for games optimization !
You can poll the msgproc, and get all the windows events... Or if it's just your application, you can setup on click events and mouse move envets...
What i do (I find generally quicker then polling msgproc), is to setup DirectX - DirectInput for Mouse and Keyboard, and poll the Mouse and Keyboard directly.
Catch user mouse click events in window.
POSMaster
The easiest case is if the window in question is the form you are writing. There are Form mouse down, mouse up and click events as a part of windows forms.
These events come with mouse event arguments what key is down and the relative cursor location with in the form.
If you are interested in mouse clicks on a system wide basis via the API.
beedub
Oooooh. I read this as to whether they clicked in the window or not.
The control mouse event with it's event argument is exactly what you want.
Section Z
GiovanniP
grandcanary
Protected
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As IntegerPublic Shared Function IsSelectMouseKeyDown() As Boolean
Const VK_LBUTTON = &H1 Const VK_RBUTTON = &H2
If Not System.Windows.Forms.SystemInformation.MouseButtonsSwapped Then
IsSelectMouseKeyDown = GetAsyncKeyState(VK_LBUTTON)
ElseIsSelectMouseKeyDown = GetAsyncKeyState(VK_RBUTTON)
End If End FunctionYou'll have to poll this at intervals and look for whether mouse keys are down.
You can look at the curso position (Another API routine) which gives screen coordinates. You then get to see if the cursor coordinates fall inside the windows of the program.
There will be asynchronous form events that will firs when events occur. They are declared at design time you.
On the left form window find "Form events". The right one will now show you the excutable events which can contain your code you meet your needs.
Ayyappan
not thank you from all people using tools detecting directx use - mainly for games optimization !
rgparkins
I want to collect the mouse click information for entire OS instead of just my App. pulling message queue seems a solution
bobmarble
I want to collect user information about where he/she clicked inside the window
David Maltby
What i do (I find generally quicker then polling msgproc), is to setup DirectX - DirectInput for Mouse and Keyboard, and poll the Mouse and Keyboard directly.
Dustin.