# Wizard style dialogs

This topic is 3650 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am trying to create a wizard style dialog. It is a pretty simple dialog, and 99% of the program does not use the windows GUI system, so I'm just using straight winapi with the dialog resource editor. Currently what I have done is I've made a dialog resource that is the dialog with a blank page, i.e. just a blank space with prev, next, finish, cancel buttons. Each page is another dialog resource. I create all the dialogs at once, the pages are child windows of the main dialog. When the user changes pages, I show the current page, and hide the rest of the pages. Problems: 1) The tab order is wrong. No matter what control the user is currently on in any page, tab always jumps to the 4 prev, next, finish, cancel buttons. Then it cycles through those buttons only. 2) I am trying to use DM_SETDEFID to change the default button depending on whether finish or next are enabled:

if(finishEnabled)
SendMessage(g_hDlg, DM_SETDEFID, IDC_FINISH, 0);
else
SendMessage(g_hDlg, DM_SETDEFID, IDC_NEXT, 0);

This works for all but when the dialog is initialized. If I try to call this code from within WM_INITDIALOG, the cancel button ends up being the default button. I tried to put it in WM_SHOWWINDOW, but that made BOTH the cancel button and finish buttons have the default 'look', but cancel still behaved as the default button.

##### Share on other sites
I call shenanigans on this post. The title was obviously written in a misleading manner so that I would click on it thinking that we would be talking about how Wizards speak.

How disappointing...

• 17
• 11
• 15
• 9
• 49
• ### Forum Statistics

• Total Topics
631393
• Total Posts
2999774
×