3. GDI
It enables applications to use graphics
It do not access the graphics hardware directly interacts with device drivers More or less
obsolete (Direct2D)
4. Dialog box
Much of the behind-the-scenes work, such as closing and destroying the dialog window, is handled
automatically with modal dialog boxes.
With modeless dialog boxes, however, especially in dialog-based applications, you need to override
several inherited member functions.
Overriding the inherited member functions allows you to correctly close and destroy the dialog
window.
All dialog boxes—whether standard or custom—are created using two components: a dialog resource
and a dialog class derived from the CDialog class.
The dialog resource represents the visual aspect of the dialog box, and the dialog class provides
programmatic access to the dialog box.
5. Modal
Modal dialog boxes require users to close or cancel the dialog box before they can continue
working with an application.
Once a modal message box appears on your screen, you cannot access any other window
in an application until you close the message box.
6. Modeless
In comparison to a modal dialog box, modeless dialog boxes do not need to be closed
before you return to another window in the application.
Modeless dialog boxes function more like frame windows and other types of primary
application windows.
Modeless dialog boxes require quite a bit more work than modal dialog boxes.
7. Displaying Modal Dialog Boxes
You display a modal dialog box from an application’s InitInstance() function, the same way you display
a frame window. You instantiate an object of the dialog class and use the inherited DoModal()
function to display the modal dialog box. By default, if a user clicks a button containing a resource ID
of IDOK or IDCANCEL, the dialog box closes.
The IDOK resource ID represents the OK button, and the IDCANCEL resource ID represents the Cancel
button. The DoModal() function returns an integer value representing the resource ID that caused the
dialog box to close. You use these resource IDs in an if statement to take the appropriate action,
depending on whether the user pressed the OK button or the Cancel button.
8. Displaying Modeless Dialog
Boxes
Construct using the resource editor in the same way as a modal dialog.
Launch it by calling CDialog::Create().instead of CDialog::DoModal()
Dismiss it by calling CWnd::DestroyWindow().
instead of CDialog::EndDialog().you must NEVER call EndDialog() for a modeless dialog.
you MUST override OnCancel() in order to prevent it from calling EndDialog().
9. Working with Controls
Dialog boxes typically contain groups of controls through which a user interacts with an
application.
Controls are user interface items such check boxes, command buttons, text boxes, and other
objects.
You add controls to a dialog box by using the Controls toolbar in the Dialog Editor.
10. MFC
Controls are the user interface objects used to create interfaces for Windows applications.
Most Windows applications are nothing but a collection of controls arranged in a way that
appropriately implements the functionality of the program.
There are only six basic controls - CStatic, CButton, CListBox, CComboBox, CEdit, and CScrollBar -
along with some minor variations (Windows added a collection of about 15 enhanced controls as
well).
11.
12. Controls
The Resource Editor makes it easy to add controls to dialog boxes.
The controls are automatically created when the dialog is created.
The Class Wizard makes it easy to link these controls to dialog class member functions or member
variables.
13. Controls
Controls are actually Windows Controls are Child Windows
They have their own window procedures (provided by Windows).
In MFC, they inherit all the CWnd functionality.Controls are Child Windowsclipped to parent, move
with parent, destroyed with parent.when using VC++ Resource Editor - parent is usually a dialog class
derived from CDialog.send WM_COMMAND notifications to parent.