Why dont you try sending message to your pop up windows Or communicate with them using any events or mutex and make them close by them selves. I dont know your senario well but this is a suggestion.
Why dont you try sending message to your pop up windows
The problem is that I don't know what is the hwnd of the new created modal until I call DoModal().
The problem is that DoModal() blocks so I can't get the hwnd anyway ...
Your code isn't clear. Please post the code that shows where the main dialog displays dialog1 and dialog2. Does dialog1 display dialog2? If so, display that code as well.
Besides all why would you want to close [b]modal dialog from any place?
Modal dialog disables main window and all popups. Modal is designed to collect data; user should decide when to close it and how (OK or Cancel).
If you use dialog to display status or progress, you should use modeless dialogs.
Another thing: why one modal dialog over another?
I think you should rethink your design or be clearer describing what you are trying do. Remember that nobody has a crystal ball.
There are only 10 types of people in the world: Those who understand binary and those who do not.
Bookmarks