How do we hide Modal Dialog Boxes?
-
:(( I have a modal dialog box A and when it runs, it stays on top. Is there a way to hide the dialog box or set dialog box A at the back of another modal dialog box? I'm using MFC. I'm kinda desperate for solutions. waxie -- modified at 5:30 Wednesday 18th January, 2006
-
:(( I have a modal dialog box A and when it runs, it stays on top. Is there a way to hide the dialog box or set dialog box A at the back of another modal dialog box? I'm using MFC. I'm kinda desperate for solutions. waxie -- modified at 5:30 Wednesday 18th January, 2006
CWnd
class provides aShowWindow()
function which you could passSW_HIDE
/SW_SHOW
parameters...
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...] -
CWnd
class provides aShowWindow()
function which you could passSW_HIDE
/SW_SHOW
parameters...
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...]But if we call ShowWindow() say: int m_nExitCode = dlg.DoModal(); dlg.ShowWindow(SW_SHOWMINIMIZED); This will pass activation of window A to another window. I want the window to be still running but just invisible. If only it's a modeless window it will be much easier. Thanks for the reply by the way. :-O waxie
-
:(( I have a modal dialog box A and when it runs, it stays on top. Is there a way to hide the dialog box or set dialog box A at the back of another modal dialog box? I'm using MFC. I'm kinda desperate for solutions. waxie -- modified at 5:30 Wednesday 18th January, 2006
Why do you want to hide your modal dialog box ? Hidding it won't allow you to make it 'non-modal'. In other words, it means that if you hide, you won't be able to close ('cause its hidden) but you won't be able neither to work with the rest of your application because your modal dialog is still opened (even if hidden). Then, your user will have a little problem to close your application, don't you think ? Maybe a better approach to that is to use modeless dialogs (they will allow you to work with the rest of your application but they are a little bit more complicated to manage)
-
Why do you want to hide your modal dialog box ? Hidding it won't allow you to make it 'non-modal'. In other words, it means that if you hide, you won't be able to close ('cause its hidden) but you won't be able neither to work with the rest of your application because your modal dialog is still opened (even if hidden). Then, your user will have a little problem to close your application, don't you think ? Maybe a better approach to that is to use modeless dialogs (they will allow you to work with the rest of your application but they are a little bit more complicated to manage)
The dialog was created with a resource so i have no choice but to display it as modal. Sorry I'm still a novice mfc programmer. I will be the one who will close the modal dialog box and not the user. Say, I have a modal dialog box with a progress bar, and another modal dialog box which runs an update. How do i hide the one which does the update? waxie
-
The dialog was created with a resource so i have no choice but to display it as modal. Sorry I'm still a novice mfc programmer. I will be the one who will close the modal dialog box and not the user. Say, I have a modal dialog box with a progress bar, and another modal dialog box which runs an update. How do i hide the one which does the update? waxie
modal has nothing do deal with resources... you have a CDialog inherited class, which you associates with a dialog resource... then, when you create you dialogbox, you can call either .DoModal() on it (to make it modal), or .Create() for a modeless dialog. if this code wasn't written directly but you but but the wizard, then go to where the dialog is created and where domodal() is called, and change it...
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...] -- modified at 5:52 Wednesday 18th January, 2006 -
:(( I have a modal dialog box A and when it runs, it stays on top. Is there a way to hide the dialog box or set dialog box A at the back of another modal dialog box? I'm using MFC. I'm kinda desperate for solutions. waxie -- modified at 5:30 Wednesday 18th January, 2006
Probably you should look at the option of creating modeless dialog box
-Prakash
-
:(( I have a modal dialog box A and when it runs, it stays on top. Is there a way to hide the dialog box or set dialog box A at the back of another modal dialog box? I'm using MFC. I'm kinda desperate for solutions. waxie -- modified at 5:30 Wednesday 18th January, 2006
Only chance for you is Modaless dialog. instead of calling DoModal() call Create() example MyClass *obj; obj = new MyClass(); obj->Create(IDD_DIALOG1,this); obj->ShowWindow(SW_SHOW);
-
The dialog was created with a resource so i have no choice but to display it as modal. Sorry I'm still a novice mfc programmer. I will be the one who will close the modal dialog box and not the user. Say, I have a modal dialog box with a progress bar, and another modal dialog box which runs an update. How do i hide the one which does the update? waxie
Wow, I think your are mixing everything :~ Ok, first, using a modeless dialog box is still done with a ressource. In fact the only thing that changes is that it lets the user work with the rest of your program. Let's take an example:
CMyModalDlg Dlg; Dlg.DoModal(); MessageBox("Test message");
If you run this code, you will see that the "Test message" (message box) will only be displayed when you close your modal dialog. It means that your program 'stops' at this line to let the message box receive the inputs from the user. Once the dialog is closed, the DoModal function is exited and your program continues. But this also means that your program main loop is not processed thus you cannot work with the rest of your application (I think you already discovered that). Now, if instead of using a dialog box, you use a modeless one, you won't call the DoModal function (but rather simply ShowWindow) and thus, your program will continue and show immediatley the message box. This means also that you will still be able to 'work' with the rest of your program (click on buttons,...). I suggest you to search for modeless articles on this website to see how to use them. In your example, you won't be able to have two moal dialogs (because of what I explained below). Or, the only way to do it is to open one 'inside the code' of the first one. But, then the first one won't be refreshed and processed. I suggest that you buy yourself a book about the MFC because you are lacking some important concepts there. And it is impossible to explain in detail through a forum. Hope this helps -
:(( I have a modal dialog box A and when it runs, it stays on top. Is there a way to hide the dialog box or set dialog box A at the back of another modal dialog box? I'm using MFC. I'm kinda desperate for solutions. waxie -- modified at 5:30 Wednesday 18th January, 2006
waxie wrote:
Is there a way to hide the dialog box
http://www.voidnish.com/articles/ShowArticle.aspx?code=dlgboxtricks[^]
waxie wrote:
r set dialog box A at the back of another modal dialog box?
Use
SetWindowPos
Api in theOnInitDialog
Virtual Function of yourDialog
and Instead of returningTRUE
from same function returnFALSE
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
-
CWnd
class provides aShowWindow()
function which you could passSW_HIDE
/SW_SHOW
parameters...
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...]toxcct wrote:
CWnd class provides a ShowWindow() function which you could pass SW_HIDE/SW_SHOW parameters...
In Case of Modal Dialog, same will not work!, see my reply to actual poster!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
-
:(( I have a modal dialog box A and when it runs, it stays on top. Is there a way to hide the dialog box or set dialog box A at the back of another modal dialog box? I'm using MFC. I'm kinda desperate for solutions. waxie -- modified at 5:30 Wednesday 18th January, 2006
This will help you... http://www.codeproject.com/dialog/dlgboxtricks.asp[^]
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
Wow, I think your are mixing everything :~ Ok, first, using a modeless dialog box is still done with a ressource. In fact the only thing that changes is that it lets the user work with the rest of your program. Let's take an example:
CMyModalDlg Dlg; Dlg.DoModal(); MessageBox("Test message");
If you run this code, you will see that the "Test message" (message box) will only be displayed when you close your modal dialog. It means that your program 'stops' at this line to let the message box receive the inputs from the user. Once the dialog is closed, the DoModal function is exited and your program continues. But this also means that your program main loop is not processed thus you cannot work with the rest of your application (I think you already discovered that). Now, if instead of using a dialog box, you use a modeless one, you won't call the DoModal function (but rather simply ShowWindow) and thus, your program will continue and show immediatley the message box. This means also that you will still be able to 'work' with the rest of your program (click on buttons,...). I suggest you to search for modeless articles on this website to see how to use them. In your example, you won't be able to have two moal dialogs (because of what I explained below). Or, the only way to do it is to open one 'inside the code' of the first one. But, then the first one won't be refreshed and processed. I suggest that you buy yourself a book about the MFC because you are lacking some important concepts there. And it is impossible to explain in detail through a forum. Hope this helpsThank you very much for your reply Cedric! :) I sorta crashed myself into MFC. I had to do many things immediately, and learn in the process. Yeah, I admit I have a lousy mfc foundation and sorta did not have a good mfc first impression (I was a java kid). I am sort of in an experimenting stage right now. Good thing there are many of you experts here who can share your thoughts. Thanks! Waxie
-
This will help you... http://www.codeproject.com/dialog/dlgboxtricks.asp[^]
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
Owner drawn wrote:
This will help you...
Hai, i win the race this time :)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
Yeah you're right. I didn't see your post as the page was not refreshed. I only saw it afterwards. Dang!:sigh:
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
Yeah you're right. I didn't see your post as the page was not refreshed. I only saw it afterwards. Dang!:sigh:
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
Owner drawn wrote:
I didn't see your post as the page was not refreshed. I only saw it afterwards.
Better Luck next time... Welcome to Fastest Finger Fast Competition :)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
-
Owner drawn wrote:
I didn't see your post as the page was not refreshed. I only saw it afterwards.
Better Luck next time... Welcome to Fastest Finger Fast Competition :)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
Sure buddy! Wait and watch :laugh:
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
Thank you very much for your reply Cedric! :) I sorta crashed myself into MFC. I had to do many things immediately, and learn in the process. Yeah, I admit I have a lousy mfc foundation and sorta did not have a good mfc first impression (I was a java kid). I am sort of in an experimenting stage right now. Good thing there are many of you experts here who can share your thoughts. Thanks! Waxie
You're welcome ;)
-
Owner drawn wrote:
I didn't see your post as the page was not refreshed. I only saw it afterwards.
Better Luck next time... Welcome to Fastest Finger Fast Competition :)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
ThatsAlok wrote:
Welcome to Fastest Finger Fast Competition
:sigh: i was still running the Fastest Nose Contest... :((
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...] -
ThatsAlok wrote:
Welcome to Fastest Finger Fast Competition
:sigh: i was still running the Fastest Nose Contest... :((
TOXCCT >>> GEII power
[toxcct][VisualCalc 2.20][VCalc 3.0 soon...]