Jump to content

Finding a modal window.


Recommended Posts

Hi.

I have a sightly complicated problem. Please read the post carefully before answering.

I want to find the "active modal" window of an application, whereas "active modal" is defined as:

- the window is modal

- you can actually interact with the window, that means that no other modal window blocks that window.

Things that don't work:

WinGetHandle("") - return the system wide active window, and not the "active modal" window of an application.

My ideas:

1. Find a modal window:

w: IsModal(w)

2. Enusure w is not blocked by another modal window:

there exists no c: IsModal© and owner© contains w

whereas owner© return all owner windows of c recursively.

The check for modality could check if a window has DS_MODALFRAME or WS_EX_MODALFRAME style.

I am not 100%ly sure which one to use.

Sounds very complicated, right. Is there a easier way to do it? Is my way working at all?

The thing I want to achieve with this:

I want to check if there is a error/warning message box present for a given application.

Any ideas?

Regards!

Edited by SamuelKerschbaumer
Link to comment
Share on other sites

Hi.

I have a sightly complicated problem. Please read the post carefully before answering.

I want to find the "active modal" window of an application, whereas "active modal" is defined as:

- the window is modal

- you can actually interact with the window, that means that no other modal window blocks that window.

Things that don't work:

WinGetHandle("") - return the system wide active window, and not the "active modal" window of an application.

My ideas:

1. Find a modal window:

w: IsModal(w)

2. Enusure w is not blocked by another modal window:

there exists no c: IsModal© and owner© contains w

whereas owner© return all owner windows of c recursively.

The check for modality could check if a window has DS_MODALFRAME or WS_EX_MODALFRAME style.

I am not 100%ly sure which one to use.

Sounds very complicated, right. Is there a easier way to do it? Is my way working at all?

The thing I want to achieve with this:

I want to check if there is a error/warning message box present for a given application.

Any ideas?

Regards!

You could use WinExist(), if you know the info for the error message window.
EndFuncAutoIt is the shiznit. I love it.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...