case WM_INITDIALOG:
{
// Set Focus to start button
SendMessage( hwndDlg, WM_SETFOCUS, (WPARAM)GetDlgItem(hwndDlg, BTN_START), NULL );
//SetFocus(GetDlgItem(hwndDlg, BTN_START));
}break;
Win32: setting focus impossible!?
Hey guys!
Ich getting crazy trying to set the focus to a button in a dialog.
In the WindowProc of the dialog I have the following:
But neither sending the WM_SETFOCUS message nor using SetFocus() changes a thing. The focus is always on another button, no matter what I do...
Any help is apreciated! Thaaaaanks :-D
Did you read the MSDN for WM_INITDIALOG?
Quote:Return Value
The dialog box procedure should return TRUE to direct the system to set the keyboard focus to the control given by hwndFocus. Otherwise, it should return FALSE to prevent the system from setting the default keyboard focus.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement