Skip to content

Commit

Permalink
Start10: Un-hardcode Program Files path
Browse files Browse the repository at this point in the history
  • Loading branch information
Amrsatrio committed Nov 2, 2024
1 parent cc9b6b3 commit fc25c25
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ep_startmenu/ep_sm_main_cpp.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <Windows.h>
#include <ShlObj_core.h>
#include <windows.foundation.h>
#include <windows.applicationmodel.resources.core.h>

Expand Down Expand Up @@ -55,8 +56,13 @@ extern "C" HRESULT LoadOurShellCommonPri()

ComPtr<ABI::Windows::ApplicationModel::Resources::Core::Internal::ISystemResourceManagerExtensions2> 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;
Expand Down

0 comments on commit fc25c25

Please sign in to comment.