diff --git a/ep_startmenu/ep_sm_main_cpp.cpp b/ep_startmenu/ep_sm_main_cpp.cpp index 0e1447d48..bd5075f1c 100644 --- a/ep_startmenu/ep_sm_main_cpp.cpp +++ b/ep_startmenu/ep_sm_main_cpp.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -55,8 +56,13 @@ extern "C" HRESULT LoadOurShellCommonPri() ComPtr pSystemResourceManagerExtensions2; pResourceManager.As(&pSystemResourceManagerExtensions2); + WCHAR wszPath[MAX_PATH] = {}; - wcscat_s(wszPath, MAX_PATH, L"C:\\Program Files\\ExplorerPatcher\\Windows.UI.ShellCommon.pri"); + hr = SHGetFolderPathW(nullptr, CSIDL_PROGRAM_FILES, nullptr, SHGFP_TYPE_CURRENT, wszPath); + if (FAILED(hr)) + return hr; + + wcscat_s(wszPath, MAX_PATH, L"\\ExplorerPatcher\\Windows.UI.ShellCommon.pri"); hr = pSystemResourceManagerExtensions2->LoadPriFileForSystemUse(wszPath); return hr;