• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

Mouse click traping

I have a modal form. How can I get an event (execute some code) when the user click outside the modal form?
(I want to hide the modal form when the user clicks outside)

Are there some API functions to get mouse events on other forms under the modal form?
A hook maybe? Would a hook (subclassing) work?
0
Azmodan
Asked:
Azmodan
1 Solution
 
corvanderlindenCommented:
There is a system wide mouse hook. Never used it myself (and surely not in production code), but I've got sample code if you're interested, but then I need your email
0
 
AzmodanAuthor Commented:
sure
my email is: rvescan@home.ro

10x
0
 
AzmodanAuthor Commented:
this is what i was looking for

10x

ps: why have you have - surely not in production code? :)
it's not stable?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Arthur_WoodCommented:
doesn't that COMPLETELY DEFEAT the purpose of a MODAL form.  If you don't want the form to be MODAL, why open it as MODAL, in the first place?

A Modal form is intended to REQUIRE the user to respond to THAT form BEFORE they can do ANYTHING else.  If you then hide the form when they click anywhere else, then the form was not MODAL in the first place.
0
 
AzmodanAuthor Commented:
sure
but in IE... I am allowed to show only modal forms, and i don't want that
0
 
corvanderlindenCommented:
ps: why have you have - surely not in production code? :)^

Subclassing and hooking in VB is always a little risky. Just test a lot and know what you are doing

Good luck
0
 
smc1979Commented:
I am looking to do the same thing. By any chance can I get a copy to sent to me?? thanks!

webmaster@croftssoftware.com
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now