ok, made a little test app.
simply launches a dialog with ok, cancel and an edit control.
I used SetFocus() and lo and behold, the edit control indeed got focus, without SetFocus the ok button recieves default focus.
Code:
BOOL CALLBACK DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
HWND hEdit = GetDlgItem(hDlg, IDC_EDIT1);
switch(Msg)
{
case WM_INITDIALOG:
SetDlgItemText(hDlg, IDC_EDIT1, L"This should be active.");
SetFocus(hEdit);
return false;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
case IDCANCEL:
EndDialog(hDlg, 0);
return true;
}
break;
}
return false;
}