People talk to other people and exchange their inputs via verbal dialogs. Dialog boxes are the medium to talk to its users and collect their inputs. A dialog box usually contains one or more controls/widgets with which the user enters text, chooses options, or directs the action of the command. Dialog boxes are primarily of two types - modal and modeless.
Modal dialog creates an UI thread and pops above parent window. This dialog gets curser focus on top of parent window and completely blocks parent. Parent windows cannot get focus until dialog closes. About box of any application is a good example of modal dialog.
DialogBox function which is basically a macro creates a modal dialog box from a dialog box template resource. DialogBox does not return control until the specified callback function terminates the modal dialog box by calling the EndDialog function. The DialogBox macro uses the DialogBoxParam function.
Modeless dialog is one which opens on top of parent window but still parent can get focus and process events. Modeless dialog does not block parent window and this is needed when users need to enter frequent inputs and same time want to get the reflection in the parent window. Find/Replace dialog is a good example of modeless dialog.
CreateDialog macro creates a modeless dialog box from a dialog box template resource. The CreateDialog macro uses the CreateDialogParam function.
About our authors: Team EQA
Where is WinMain() function in MFC application ?
MFC hides WinMain in its framework and includes source file on WinMain(). This explains how framework calls global CWinApp::Initinstance() from entry WinMain.
What is the utility of CWinApp class?
This is constructed during global C++ objects are constructed and is already available when Windows calls the WinMain function, which is supplied by the ...
Basic steps in Win32 GUI Application with source code.
Define a custom Window class structure, Register the class name, CreateWindow, Show windows and write message get and dispatch loop statements. Define the Window CallBack procedure and write the handlers.
What is a Window CallBack procedure and what is its utility?
DispatchMessage() is a API which indirectly triggers the Window CallBack procedure. Message structure members from this function are passed to the CallBack procedure. CallBack procedure should implement event handlers depending on the need of the application.
What are LPARAM and WPARAM in window proc function?
LPARAM and WPARAM are the two parameters in Window CallBack procedure. They signifies parameters of various events. They are used in handing individual events.
What are the basic steps of a typical MFC based application?
We need to write WinMain and need to follow all these in a Win32 application. However we need not to write much if we are writing an application with MFC ...
Questions index C Questions C++ Questions Win32 MFC COM/DCOM DLL Questions
Compilers & Editors
Download Visual Studio Download XCode Download Visual Studio Code Android studio install sdk Eclipse installer Best C compilers IDEs
Development system setup
Windows media creation tool MSDN subscription Ubuntu virtualbox
New updated posts
Why learn C? Calculate weighted average