[APPWIZ] Make shortcut name selected on creation (#2184)

This commit is contained in:
Jose Carlos Jesus 2020-04-30 07:02:33 +01:00 committed by GitHub
parent f86a0e41ac
commit 6d739cb2ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -275,8 +275,11 @@ WelcomeDlgProc(HWND hwndDlg,
break; break;
if (SHGetPathFromIDListW(pidllist, szPath)) if (SHGetPathFromIDListW(pidllist, szPath))
{
SetDlgItemTextW(hwndDlg, IDC_SHORTCUT_LOCATION, 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 */ /* Free memory, if possible */
CoTaskMemFree(pidllist); CoTaskMemFree(pidllist);
break; break;
@ -405,6 +408,8 @@ FinishDlgProc(HWND hwndDlg,
/* TODO: Use shell32!PathCleanupSpec instead of DoConvertNameForFileSystem */ /* TODO: Use shell32!PathCleanupSpec instead of DoConvertNameForFileSystem */
DoConvertNameForFileSystem(pContext->szDescription); DoConvertNameForFileSystem(pContext->szDescription);
SetDlgItemTextW(hwndDlg, IDC_SHORTCUT_NAME, 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) else if (lppsn->hdr.code == PSN_WIZFINISH)
{ {