Krishna Murthy Krishna.Murthy@guptaworldwide.com writes:
/**
* if the next control is push button, then draw default push button
* rectangle.
*
* if the next control is not a push button, then draw the push button
* rectangle for the default control.
*
* Call SetDefButton to draw the default rectangle, but do not change the
* default push button ID (idResult) - As Per MSDN
*/
if ( !(SendMessageW(hwndDest, WM_GETDLGCODE, 0, 0 ) &
(DLGC_UNDEFPUSHBUTTON | DLGC_BUTTON)) )
hwndDest = GetDlgItem(hwnd, idSaveResult);
DEFDLG_SetDefButton( hwnd, dlgInfo, GetDlgCtrlID(hwndDest) );
dlgInfo->idResult = idSaveResult;
It seems you are doing redundant work here, since DEFDLG_SetDefButton will also send the same WM_GETDLGCODE. Wouldn't a simpler fix be to have DEFDLG_SetDefButton not set idResult unless it really changed the default button?