winapimodal-dialogmainwindow

Check, if dialog window "locks" main window


I'm doing Surface Automation of an application. The Automation is asynchron. Sometimes, a Dialog window occures and locks the mainwindow for further Access.

I'm using C++ / Win32API, C# or VB. I can get the main window by the processID and want to find (or write) a function, giving me true or false if the main window is locked by an unexpected Dialog window.


Solution

  • Modal windows disable their owner windows. So you need to call IsWindowEnabled on the main window.