Module: wine Branch: master Commit: 7ed705eb2e0fe4b36cbcc10ee778ad44156d0faa URL: http://source.winehq.org/git/wine.git/?a=commit;h=7ed705eb2e0fe4b36cbcc10ee7...
Author: Rob Shearman rob@codeweavers.com Date: Fri Jan 26 19:54:24 2007 +0000
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.
---
dlls/credui/credui_main.c | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/dlls/credui/credui_main.c b/dlls/credui/credui_main.c index 5294b21..8c21d13 100644 --- a/dlls/credui/credui_main.c +++ b/dlls/credui/credui_main.c @@ -71,10 +71,26 @@ static INT_PTR CALLBACK CredDialogProc(H case WM_INITDIALOG: { 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); + 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) SetWindowTextW(hwndDlg, params->pszCaptionText); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); return FALSE; } case WM_COMMAND: