Article ID: 114612
Article Last Modified on 7/11/2005
WNDCLASS wc;
wc.style = CS_DBLCLKS | CS_SAVEBITS | CS_BYTEALIGNWINDOW;
wc.lpfnWndProc = DefDlgProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = DLGWINDOWEXTRA;
wc.hInstance = hinst;
wc.hIcon = LoadIcon(hinst, "DialogIcon");
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = COLOR_WINDOW + 1;
wc.lpszMenuName = NULL;
wc.lpszClassName = "MyDlgClass";
RegisterClass(&wc);
NOTE: The default dialog window procedure, DefDlgProc(), is used as the
window procedure of the class. This causes windows of this class to
behave as standard dialogs. The cbWndExtra field has to be assigned to
DLGWINDOWEXTRA - the dialog box stores its internal state information in
these extra window bytes. The icon to be used when the dialog box is
minimized is assigned to the hIncon field.
IDD_MYDIALOG DIALOG 0, 0, 186, 92
CLASS "MyDlgClass"
:
DialogBox (hinst,
MAKEINTRESOURCE (IDD_MYDIALOG),
NULL,
(DLGPROC)MyDlgFunc);
MyDlgFunc() is the dialog function implemented by the application. When
the dialog box is minimized, it will use the icon specified in the
private class.Keywords: kbhowto kbdlg KB114612