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?
AzmodanAsked:
Who is Participating?
 
corvanderlindenConnect With a Mentor Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
All Courses

From novice to tech pro — start learning today.