I’ve created a window using CreateWindowEx which functions as a wizard dialog using the following code;
DWORD dwStyle = WS_DLGFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_OVERLAPPEDWINDOW;
m_hWnd = CreateWindowEx(WS_EX_APPWINDOW, _T("WIZARD"), _T("SETUP"), dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, WIZARD_WIDTH, WIZARD_HEIGHT, NULL, NULL, g_hInstance, this);
In the WM_CREATE handler I create the bottom ‘Next’, ‘Back’ and ‘Cancel’ buttons, on the Next’ button I set the style BS_DEFPUSHBUTTON and I send the DM_SETDEFID to the window with the ID of the next button. The button displays like a next button but hitting return on any of the input fields does nothing (None have ES_WANTRETURN set).
What am I doing wrong? I can post more code if I’ve missed anything vital out.
Thanks,
J
The
DM_SETDEFIDmessage is normally processed byDefDlgProc. If you’re callingDefWindowProcinstead, then you need to handle that message yourself so that whenIsDialogMessagesends your window aDM_GETDEFIDmessage, you’ll know how to respond.