[CONTROL] OpenShellFolder: Add file browser fallback

If Explorer shell is not available, use ReactOS's alternative file browser instead.
CORE-19648
This commit is contained in:
Thamatip Chitpong 2024-06-08 22:29:42 +07:00
parent 48c036e7e7
commit 8398c9fcfb

View file

@ -74,15 +74,16 @@ OpenShellFolder(LPWSTR lpFolderCLSID)
WCHAR szParameters[MAX_PATH]; WCHAR szParameters[MAX_PATH];
/* /*
* Open a shell folder using "explorer.exe". The passed CLSIDs * Open a shell folder using "explorer.exe". If Explorer shell is not
* are all subfolders of the "Control Panel" shell folder. * available, use ReactOS's alternative file browser instead.
* The passed CLSIDs are all subfolders of the "Control Panel" shell folder.
*/ */
StringCbCopyW(szParameters, sizeof(szParameters), L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"); StringCbCopyW(szParameters, sizeof(szParameters), L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}");
StringCbCatW(szParameters, sizeof(szParameters), lpFolderCLSID); StringCbCatW(szParameters, sizeof(szParameters), lpFolderCLSID);
return (INT_PTR)ShellExecuteW(NULL, return (INT_PTR)ShellExecuteW(NULL,
L"open", L"open",
L"explorer.exe", GetShellWindow() ? L"explorer.exe" : L"filebrowser.exe",
szParameters, szParameters,
NULL, NULL,
SW_SHOWDEFAULT) > 32; SW_SHOWDEFAULT) > 32;