From 6d739cb2cebbf88c245c2c56cd28e57fb044c231 Mon Sep 17 00:00:00 2001 From: Jose Carlos Jesus Date: Thu, 30 Apr 2020 07:02:33 +0100 Subject: [PATCH] [APPWIZ] Make shortcut name selected on creation (#2184) --- dll/cpl/appwiz/createlink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dll/cpl/appwiz/createlink.c b/dll/cpl/appwiz/createlink.c index e51403658f5..c8aeee5c451 100644 --- a/dll/cpl/appwiz/createlink.c +++ b/dll/cpl/appwiz/createlink.c @@ -275,8 +275,11 @@ WelcomeDlgProc(HWND hwndDlg, break; if (SHGetPathFromIDListW(pidllist, szPath)) + { SetDlgItemTextW(hwndDlg, IDC_SHORTCUT_LOCATION, szPath); - + SendDlgItemMessageW(hwndDlg, IDC_SHORTCUT_LOCATION, WM_SETFOCUS, 0, 0); + SendDlgItemMessageW(hwndDlg, IDC_SHORTCUT_LOCATION, EM_SETSEL, 0, -1); + } /* Free memory, if possible */ CoTaskMemFree(pidllist); break; @@ -405,6 +408,8 @@ FinishDlgProc(HWND hwndDlg, /* TODO: Use shell32!PathCleanupSpec instead of DoConvertNameForFileSystem */ DoConvertNameForFileSystem(pContext->szDescription); SetDlgItemTextW(hwndDlg, IDC_SHORTCUT_NAME, pContext->szDescription); + SendDlgItemMessageW(hwndDlg, IDC_SHORTCUT_NAME, EM_SETSEL, 0, -1); + SetFocus(GetDlgItem(hwndDlg, IDC_SHORTCUT_NAME)); } else if (lppsn->hdr.code == PSN_WIZFINISH) {