Visual C++ and MFC Fundamentals Chapter 12: Dialog-Based Windows
// TODO: Add your message handler code here and/or call default
MessageBox("In order to dismiss this dialog box, "
"click either OK or Cancel");
// CDialog::OnClose();
}
- Execute the application. Display the Dynamic Objects dialog and click its system
Close button to close - Close the dialog box using either the OK or the Cancel buttons. Also, close the
application and return to MSVC - Open the Geometry application. If you do not have it, open the Geometry1
application that accompanies this book - As done for the CDynamicDlg class above, add a WM_PAINT message for the
CQuadrilateral, the CCircular, and the CGeome3D classes - Save all
13.2.3..Control-Related Messages.................................................................
WM_CTLCOLOR: Once a control has been created, it can be displayed on the screen.
At any time, whether before the control is displayed or after it has been displayed, if you
need to perform some type of drawing such as changing its color, you can use the
WM_CTLCOLOR message which fires the OnCtlColor() event.
Scroll Bar Messages: As we will learn when studying scroll bars and thumb-based
controls, a dialog-based object can be equipped with scroll bars, just like a frame of a
view-based application. We will also see that these controls do not handle their own
scrolling messages. Ther rely on their host.
If a dialog object is equipped with one or two scroll bars or one of its controls is based on
scrolling operations, when the user clicks a scroll bar, the OnHScroll() or the
OnVScroll() event is sent based on the WM_HSCROLL or the WM_VSCROLL
messages respectively.