Click here to Skip to main content
15,880,725 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
I need to detect global (off my form and/or when my form is minimized) double clicks. I want my form to pop up when the user double clicks on another form (my program is a helper program). Then my program will disappear when the user single clicks off my form.
Posted

1 solution

Your application won't normally receive notification of mouse events that happen off your window. I think you are going to have to register a mouse hook for this. For example here is the first article I found here on CP[^] for hooks in C#.
 
Share this answer
 
Comments
Johnny J. 13-Apr-11 9:58am    
Indeed, There are plenty of articles about global hooks here on the CP, both in C# and VB...
seanmchughinfo 13-Apr-11 10:55am    
Wow I can't believe I looked this over. Yep, this works perfectly. Thanks.
BobJanova 13-Apr-11 12:13pm    
Welcome.

Remember that it would be very easy to make your application extremely annoying by responding to mouse events in other applications, so there is some user experience design for you to do to make your 'helper' helpful :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900