|
-
Apr 23rd, 2007, 03:40 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Detect click on desktop !
Hello,
Is a way or another to detect mouse click, mousedown or others on the desktop?
Thanks in advance.
-
Apr 24th, 2007, 02:39 AM
#2
Thread Starter
Addicted Member
Re: Detect click on desktop !
No solutions? subclassing, listening to mouse?
-
Apr 24th, 2007, 03:27 AM
#3
Re: Detect click on desktop !
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.
-
Apr 24th, 2007, 11:50 PM
#4
Fanatic Member
Re: Detect click on desktop !
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
-
Apr 25th, 2007, 12:14 AM
#5
Re: Detect click on desktop !
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
-
Apr 25th, 2007, 04:12 AM
#6
Thread Starter
Addicted Member
Re: Detect click on desktop !
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...
-
Apr 26th, 2007, 03:30 AM
#7
Thread Starter
Addicted Member
Re: Detect click on desktop !
-
Apr 30th, 2007, 03:17 AM
#8
Thread Starter
Addicted Member
Re: Detect click on desktop !
Can we have two simultaneous message as mouse_middle_button_down and mouse_left_button_down?
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
|