Chapter 12: Dialog-Based Windows Visual C++ and MFC Fundamentals
12.1 Dialog Boxes................................................................................................
12.1.1..Overview...............................................................................................
A dialog box is a rectangular window whose main role is to host or hold other Windows
controls. For this reason, a dialog box is referred to as a container. It is the primary
interface of user interaction with the computer. By itself, a dialog box means nothing.
The controls it hosts accomplish the role of dialog between the user and the machine.
Here is an example of a dialog box:
A dialog box has the following characteristics:
?? It is equipped with the system Close button. As the only system button, this
button allows the user to dismiss the dialog and ignore whatever the user would
have done on the dialog box.
?? It cannot be minimized, maximized, or restored. A dialog box does not have any
other system button but Close.
?? It is usually modal, in which case the user is not allowed to continue any other
operation until the dialog box is dismissed.
?? It provides a way for the user to close or dismiss the dialog. Most dialog boxes
have the OK and the Cancel buttons, although this depends on the application
developer. When the dialog has the OK and the Cancel buttons, the OK button is
configured to behave as if the user had pressed Enter. In that case, whatever the
user had done would be acknowledged and transferred to the hosting dialog box,
window, or application. Pressing Esc applies the same behavior as if the user
had clicked Cancel.
Practical Learning: Creating an Application
- Start Microsoft Visual C++ or Microsoft Visual Studio
- Create a new Win32 Application or Win32 Project named ExoDialog1