Skip to content

Commit

Permalink
Clock pop up menu options now open in Control Panel
Browse files Browse the repository at this point in the history
  • Loading branch information
valinet committed Oct 25, 2021
1 parent 0d4b99d commit d6bef02
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion ExplorerPatcher/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -3466,9 +3466,38 @@ HRESULT explorer_DrawThemeTextEx(
#pragma endregion


HINSTANCE explorer_ShellExecuteW(
HWND hwnd,
LPCWSTR lpOperation,
LPCWSTR lpFile,
LPCWSTR lpParameters,
LPCWSTR lpDirectory,
INT nShowCmd
)
{
if (!wcscmp(lpFile, L"ms-settings:notifications"))
{
return ShellExecuteW(
hwnd, lpOperation,
L"shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}",
lpParameters, lpDirectory, nShowCmd
);
}
else if (!wcscmp(lpFile, L"ms-settings:dateandtime"))
{
return ShellExecuteW(
hwnd, lpOperation,
L"shell:::{E2E7934B-DCE5-43C4-9576-7FE4F75E7480}",
lpParameters, lpDirectory, nShowCmd
);
}
return ShellExecuteW(hwnd, lpOperation, lpFile, lpParameters, lpDirectory, nShowCmd);
}


DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
{
Sleep(150);
//Sleep(150);

HMODULE hShlwapi = LoadLibraryW(L"Shlwapi.dll");
if (bInstall)
Expand Down Expand Up @@ -3939,6 +3968,7 @@ __declspec(dllexport) DWORD WINAPI main(
if (bOldTaskbar)
{
VnPatchIAT(hExplorer, "api-ms-win-core-libraryloader-l1-2-0.dll", "GetProcAddress", explorer_GetProcAddressHook);
VnPatchIAT(hExplorer, "shell32.dll", "ShellExecuteW", explorer_ShellExecuteW);
VnPatchIAT(hExplorer, "user32.dll", "MonitorFromRect", explorer_MonitorFromRect);
}
VnPatchIAT(hExplorer, "user32.dll", "TrackPopupMenuEx", explorer_TrackPopupMenuExHook);
Expand Down

0 comments on commit d6bef02

Please sign in to comment.