My resource file contains a DEFPUSHBUTTON for IDCANCEL, but for some reason, they Focus on the button is not changing from IDOK to IDCANCEL.
IDD_HEALTHCARDINFO DIALOGEX 0, 0, 256, 223
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Health Card Information"
FONT 8, "MS Sans Serif", 0, 0, 0x0
SendMessage(GetDlgCtrlID(), DM_SETDEFID, IDCANCEL);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
Default button doesn't affect focus. It affects what button is activated by the ENTER key when some non-button control has focus.
You can use
OnInitDialog (and also return FALSE) to change which control has focus when the dialog opens. Or you can reorder the controls within the dialog resource.
As a side note, a dialog box that asks a Yes/No question generally shouldn't have a title of "Information".