Hello,
Is a way or another to detect mouse click, mousedown or others on the desktop?
Thanks in advance.
Printable View
Hello,
Is a way or another to detect mouse click, mousedown or others on the desktop?
Thanks in advance.
No solutions? subclassing, listening to mouse?
I guess you could try installing a low-level mouse hook and in case you get a WM_LBUTTONDOWN or WM_LBUTTONUP you could check the mouse position and use WindowFromPoint to check if the window under the cursor is the desktop window.
However you can not create a low-level mouse hook on Win9x/ME.
When the Desktop is clicked it appears to get focus (as it takes focus away from an app that had focus).
Would that effect help in any way ?
Would GetForegroundWindow be of any use ?
Wild thoughts from -
- Left field
- Left brain
- Should be Left alone
The SetWindowsHookEx API should be of help. There's no way you can detect mouse click when your lost focus on your app that's receiving the events just as Rob C stated.
Link
http://msdn2.microsoft.com/en-us/library/ms644990.aspx
Indeed, I've tried to subclass the desktop how I can. The results were bad, were nulls! I lost focus from my application before any things could happen.
A low-level subclassing is interesting... I'm going to try that...
This goes well, thanks!
Can we have two simultaneous message as mouse_middle_button_down and mouse_left_button_down?