[APPWIZ] "Create Shortcut" wizard: Only filesystem items (#5455)

- Add (BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE | BIF_SHAREABLE) flags.
- Consider the failure of SHGetPathFromIDListW.
CORE-5866
This commit is contained in:
Katayama Hirofumi MZ 2023-07-20 08:46:51 +09:00 committed by GitHub
parent 1191bcaf03
commit ca62121b4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -269,7 +269,8 @@ WelcomeDlgProc(HWND hwndDlg,
brws.hwndOwner = hwndDlg;
brws.pidlRoot = NULL;
brws.pszDisplayName = szPath;
brws.ulFlags = BIF_BROWSEINCLUDEFILES;
brws.ulFlags = BIF_BROWSEINCLUDEFILES | BIF_RETURNONLYFSDIRS |
BIF_NEWDIALOGSTYLE | BIF_SHAREABLE;
brws.lpfn = NULL;
pidllist = SHBrowseForFolderW(&brws);
if (!pidllist)
@ -281,6 +282,11 @@ WelcomeDlgProc(HWND hwndDlg,
SendDlgItemMessageW(hwndDlg, IDC_SHORTCUT_LOCATION, WM_SETFOCUS, 0, 0);
SendDlgItemMessageW(hwndDlg, IDC_SHORTCUT_LOCATION, EM_SETSEL, 0, -1);
}
else
{
SetDlgItemTextW(hwndDlg, IDC_SHORTCUT_LOCATION, NULL);
}
/* Free memory, if possible */
CoTaskMemFree(pidllist);
break;