Jump to content
Squall_FF8

How to capture a mouse click outside a modal window?

Recommended Posts

Hi guys,

 

I have a modal window above my main form. I want to do something when I click outside the modal window. How I can do that?

I tried with MouseMove, but it returns <X,Y> as <-1,-1> when the cursor is outside the modal window.
Unfortunately that is not enough because, the same values are returned when you try to do things like resize,.. so there is no guarantee that <-1,-1> is what we need.
On top of that MouseUp/Down is not even triggered when you click outside. 

Edited by Squall_FF8
more details

Share this post


Link to post

Clicking outside the modal form will not register a mouse down, even through TApplicationEvents.OnMessage. I suspect you might have to use Windows System Hooks with WH_MOUSE. I have not done this before though and as such cannot confirm if this would be the most appropriate way to do it.

 

 

Edited by PeaShooter_OMO

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×