ho provato con SetFocus e SendMessage e non ha funzionato.

Con PostMessage invece si
codice:
PostMessage(GetDlgItem(hwndDlg, IDC_EDITBOX), WM_SETFOCUS, (WPARAM) hwndDlg, 0);
hwndDlg = hwnd del dialog box
IDC_EDITBOX = identificatore del text box