Detecting a form's dialog

  • Thread starter Thread starter Michael Wong
  • Start date Start date
M

Michael Wong

How can I detect if a form has a dialog showing?

For example, in form1, I have code to show a dialog:

private void FormProduct_Closing(object sender, CancelEventArgs e)
{
// ...
MessageBox.Show(...);
// ...
}

which is not closed yet. And in another thread, I would like to know
whether form1 is available or waiting a dialog to close down (can be any
dialog, like a messageBox,...)
 
Hi Alex,

That's what I am trying to do right now. But then, I also need to know
which form it is...
For forms I show as dialog, easy, but for a MessageBox, I don't know how
to get it.
May be, I'll try with GetLastPopupWindow (Win32, but only a handle)

Thanks
 
Back
Top