Modeless Dialog Box
-
I have a MFC Application with ToolBars etc. I want to create a Modeless Dialog Box, but I do not the user to be able to click any buttons in the Main Application while this Dlg Box is displayed. Is there a way to do this, or do I have to use a Modal Dlg Box. The problem is if I have to use a Modal Dlg Box then I will have to spawn a separate thread to do this as I have to do some background processing. Thanks for your help.
-
I have a MFC Application with ToolBars etc. I want to create a Modeless Dialog Box, but I do not the user to be able to click any buttons in the Main Application while this Dlg Box is displayed. Is there a way to do this, or do I have to use a Modal Dlg Box. The problem is if I have to use a Modal Dlg Box then I will have to spawn a separate thread to do this as I have to do some background processing. Thanks for your help.
You basically want a modal dialog box, so why not create one ? I don't see how being modal or modeless changes the need for a background thread, assuming you need one at all. Christian Graus - Microsoft MVP - C++
-
I have a MFC Application with ToolBars etc. I want to create a Modeless Dialog Box, but I do not the user to be able to click any buttons in the Main Application while this Dlg Box is displayed. Is there a way to do this, or do I have to use a Modal Dlg Box. The problem is if I have to use a Modal Dlg Box then I will have to spawn a separate thread to do this as I have to do some background processing. Thanks for your help.
So disable the main application window before you show the dialog. A bit of advice - it sounds like you're trying to do some sort of progress / wait dialog. That's fine - this is a good way to go about that. But keep in mind, if you're doing some sort of lengthy processing in your primary (UI) thread, the interface won't respond or repaint while that's happening anyway, since messages won't get pumped. If you have something that is gonna take a while, see if you can't just spin off a separate thread to handle it, posting back status messages or whatever to the main thread. Trust me, it's a lot easier to plan it out and do it right the first time than it is to go back and hack around laziness later...