Always on top (modeless) dialog box
-
Hi I want to show a modeless dialog (in a SDI project) that I can use it when any other modal dialog of project is open. I set the always on top style so I can see it when any other project's modal dialog is open, but I can't use it. I must close the modal dialog first and after that I can use my first dialog(modeless). I set the parent window to CMainFrame and then NULL, but both ways did not work fine. Also I tested some other styles, but found nothing. Is there any way to do this?
-
Hi I want to show a modeless dialog (in a SDI project) that I can use it when any other modal dialog of project is open. I set the always on top style so I can see it when any other project's modal dialog is open, but I can't use it. I must close the modal dialog first and after that I can use my first dialog(modeless). I set the parent window to CMainFrame and then NULL, but both ways did not work fine. Also I tested some other styles, but found nothing. Is there any way to do this?
Hadi Dayvary wrote:
...but I can't use it.
Why? What's the problem? Does it show but can't be interacted with? Does it show but stays in the background? Does it fail to show? How, and when, are you displaying it?
Hadi Dayvary wrote:
I must close the modal dialog first and after that I can use my first dialog(modeless).
This sounds like normal behavior of a modal dialog.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
Hadi Dayvary wrote:
...but I can't use it.
Why? What's the problem? Does it show but can't be interacted with? Does it show but stays in the background? Does it fail to show? How, and when, are you displaying it?
Hadi Dayvary wrote:
I must close the modal dialog first and after that I can use my first dialog(modeless).
This sounds like normal behavior of a modal dialog.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
it's shown but can't be interacted with. I have created it in CMainFrame::OnCreate() like this :
m_dlgCalling.Create(IDD_CALLING, NULL);
m_dlgCalling.ShowWindow(SW_SHOW);or this:
m_dlgCalling.Create(IDD_CALLING, this);
m_dlgCalling.ShowWindow(SW_SHOW); -
Hi I want to show a modeless dialog (in a SDI project) that I can use it when any other modal dialog of project is open. I set the always on top style so I can see it when any other project's modal dialog is open, but I can't use it. I must close the modal dialog first and after that I can use my first dialog(modeless). I set the parent window to CMainFrame and then NULL, but both ways did not work fine. Also I tested some other styles, but found nothing. Is there any way to do this?
You can always create the modeless dialog via it's own UI thread. The issue is the modal dialog is preventing pumping of your messages.
onwards and upwards...
-
it's shown but can't be interacted with. I have created it in CMainFrame::OnCreate() like this :
m_dlgCalling.Create(IDD_CALLING, NULL);
m_dlgCalling.ShowWindow(SW_SHOW);or this:
m_dlgCalling.Create(IDD_CALLING, this);
m_dlgCalling.ShowWindow(SW_SHOW);So you are creating and showing the modeless dialog during the creation of the main frame, correct? Where does the modal dialog play into this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
So you are creating and showing the modeless dialog during the creation of the main frame, correct? Where does the modal dialog play into this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modal dialogs come when user selects an item from the menu.
-
You can always create the modeless dialog via it's own UI thread. The issue is the modal dialog is preventing pumping of your messages.
onwards and upwards...
thanks. Do you mean that I must create create a thread and then craeting the modeless dialog from that?
-
modal dialogs come when user selects an item from the menu.
And by definition, modal dialogs must be dismissed before you can interact with any windows behind them.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
And by definition, modal dialogs must be dismissed before you can interact with any windows behind them.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
I know, but I must do this for our project, There must be a way to do something like this.