Commit 7ed705eb authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

credui: Fill out the username, password and domain edit boxes from the values…

credui: Fill out the username, password and domain edit boxes from the values input to CredUIPromptForCredentialsW. Set the focus to the password edit box, unless the user edit box is empty.
parent c9c328c1
...@@ -71,10 +71,26 @@ static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, ...@@ -71,10 +71,26 @@ static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
struct cred_dialog_params *params = (struct cred_dialog_params *)lParam; struct cred_dialog_params *params = (struct cred_dialog_params *)lParam;
DWORD ret;
WCHAR user[256];
WCHAR domain[256];
SetWindowLongPtrW(hwndDlg, DWLP_USER, (LONG_PTR)params); SetWindowLongPtrW(hwndDlg, DWLP_USER, (LONG_PTR)params);
ret = CredUIParseUserNameW(params->pszUsername, user, 256, domain, 256);
if (ret == ERROR_SUCCESS)
{
SetDlgItemTextW(hwndDlg, IDC_USERNAME, user);
SetDlgItemTextW(hwndDlg, IDC_DOMAIN, domain);
}
SetDlgItemTextW(hwndDlg, IDC_PASSWORD, params->pszPassword);
if (ret == ERROR_SUCCESS && user[0])
SetFocus(GetDlgItem(hwndDlg, IDC_PASSWORD));
else
SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
if (params->pszCaptionText) if (params->pszCaptionText)
SetWindowTextW(hwndDlg, params->pszCaptionText); SetWindowTextW(hwndDlg, params->pszCaptionText);
SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
return FALSE; return FALSE;
} }
case WM_COMMAND: case WM_COMMAND:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment