Hey, I have a dailog with 2 buttons on it. I want it so that when if the use is typing in one of the edit controls that the first button will be selected otherwise the second button is selected. I've got the buttons to change but when I press enter they don't work. Also as soon as you start writing in the edit control the second button changes back to the default button. My code is below.
Code:
case EN_SETFOCUS:
SendMessage(GetDlgItem(hwnd, IDC_SEARCH), BM_SETSTYLE, BS_DEFPUSHBUTTON, true);
SendMessage(GetDlgItem(hwnd, IDC_DOWNLOAD), BM_SETSTYLE, BS_PUSHBUTTON, true);
break;
default:
SendMessage(GetDlgItem(hwnd, IDC_SEARCH), BM_SETSTYLE, BS_PUSHBUTTON, true);
SendMessage(GetDlgItem(hwnd, IDC_DOWNLOAD), BM_SETSTYLE, BS_DEFPUSHBUTTON, true);
break;