Skip to main content
Duy-NV-Niteco
Known Participant
July 14, 2016
Question

Close specific Dialog

  • July 14, 2016
  • 1 reply
  • 270 views

Hi everyone,

I meet a problem with multiple dialog.

Currently, i have 2 or 3 dialogs which opened at the same time.

But i dont know how to close exactly one given dialog.

To get a dialog window, i just know function dialogMgr->GetFrontmostDialogWindow() to get the dialog which opened last.

Does anyone know how to get a dialog by its WidgetID or something like that?

Thanks

This topic has been closed for replies.

1 reply

Inspiring
July 15, 2016

How are the dialogs being created? The best approach if you are creating the dialogs yourself would be to hold a reference to the dialog so that you can close it later.

You can also watch the commands being generated in the debug build and figure out where to attach an observer to be notified when a dialog opens, and then get a reference to the dialogs you're interested when they open so you can close them later.

Finally, check out IWindowList. Haven't tested it but it may do what you're looking for.

Lawrence