

It is not a thing that people do generally, or even occasionally.what about using SetCapture to the entire form. I'm pretty sure given the examples in the first post, it is a click on anything within the same form, but outside the control that currently has the focus.
#Gpass a viariable outside of a mouseclicked event code#
If you don't feel you have the experience to try to code it yourself, then I think you'll need to abandon the requirement.

Regardless of the two approaches I've mentioned (and the SetCapture), I don't know that anyone has enough interest to actually try to code it for you. You would repaint the obscuring form, moving the hole to the next active control, if that control needed the same "click outside" event. If the user clicks outside the active control, you'll get the mousedown event in the top form and can handle it, and hide the form to make the rest of the bottom form available. The control would have to determine that a click occurred outside the control bounds, release the capture, and then reissue the mouse event using another API call.Īnother, thinking outside the box, idea would be to have another form over the first, that is 1% opaque so you can't really see it, and with a transparent region the size of the control providing a hole to the form below to the active control. SetCapture will cause the active control to receive all mouse events. Using SetCapture may work with a bit of mouse emulation. The click may not even be over the form or even over any form relating to the app - it could be on the desktop.I'm pretty sure given the examples in the first post, it is a click on anything within the same form, but outside the control that currently has the focus. I'm guessing he can't because there may not be any control being clicked on.
