1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2025-01-24 15:22:22 +01:00
This commit is contained in:
Valentin Radu 2021-12-09 19:08:09 +02:00
parent d55307b248
commit 9c0d4edfe5

View File

@ -6,6 +6,7 @@ DWORD GUI_FileSize = 0;
BOOL g_darkModeEnabled = FALSE; BOOL g_darkModeEnabled = FALSE;
static void(*RefreshImmersiveColorPolicyState)() = NULL; static void(*RefreshImmersiveColorPolicyState)() = NULL;
static BOOL(*ShouldAppsUseDarkMode)() = NULL; static BOOL(*ShouldAppsUseDarkMode)() = NULL;
DWORD dwTaskbarPosition = 3;
BOOL IsHighContrast() BOOL IsHighContrast()
{ {
HIGHCONTRASTW highContrast; HIGHCONTRASTW highContrast;
@ -53,6 +54,7 @@ LSTATUS GUI_RegSetValueExW(
if (pcbData == sizeof(StuckRectsData) && srd.pvData[0] == sizeof(StuckRectsData) && srd.pvData[1] == -2) if (pcbData == sizeof(StuckRectsData) && srd.pvData[0] == sizeof(StuckRectsData) && srd.pvData[1] == -2)
{ {
srd.pvData[3] = *(DWORD*)lpData; srd.pvData[3] = *(DWORD*)lpData;
dwTaskbarPosition = *(DWORD*)lpData;
RegSetKeyValueW( RegSetKeyValueW(
HKEY_CURRENT_USER, HKEY_CURRENT_USER,
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StuckRectsLegacy", L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StuckRectsLegacy",
@ -119,7 +121,6 @@ LSTATUS GUI_RegSetValueExW(
&srd, &srd,
sizeof(StuckRectsData) sizeof(StuckRectsData)
); );
wprintf(L"name: %s\n", name);
} }
RegCloseKey(hKey); RegCloseKey(hKey);
SendNotifyMessageW(HWND_BROADCAST, WM_WININICHANGE, 0, (LPARAM)L"TraySettings"); SendNotifyMessageW(HWND_BROADCAST, WM_WININICHANGE, 0, (LPARAM)L"TraySettings");
@ -165,6 +166,7 @@ LSTATUS GUI_RegQueryValueExW(
if (pcbData == sizeof(StuckRectsData) && srd.pvData[0] == sizeof(StuckRectsData) && srd.pvData[1] == -2) if (pcbData == sizeof(StuckRectsData) && srd.pvData[0] == sizeof(StuckRectsData) && srd.pvData[1] == -2)
{ {
*(DWORD*)lpData = srd.pvData[3]; *(DWORD*)lpData = srd.pvData[3];
dwTaskbarPosition = srd.pvData[3];
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
return ERROR_ACCESS_DENIED; return ERROR_ACCESS_DENIED;
@ -797,6 +799,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
GetWindowsDirectoryW(wszPath, MAX_PATH); GetWindowsDirectoryW(wszPath, MAX_PATH);
wcscat_s(wszPath, MAX_PATH, L"\\explorer.exe"); wcscat_s(wszPath, MAX_PATH, L"\\explorer.exe");
Sleep(1000); Sleep(1000);
GUI_RegSetValueExW(NULL, L"Virtualized_" _T(EP_CLSID) L"_TaskbarPosition", NULL, NULL, &dwTaskbarPosition, NULL);
ShellExecuteW( ShellExecuteW(
NULL, NULL,
L"open", L"open",
@ -2079,6 +2082,7 @@ __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLin
} }
} }
} }
GUI_RegQueryValueExW(NULL, L"Virtualized_" _T(EP_CLSID) L"_TaskbarPosition", NULL, NULL, &dwTaskbarPosition, NULL);
HWND hwnd = CreateWindowEx( HWND hwnd = CreateWindowEx(
NULL, NULL,
L"ExplorerPatcher_GUI_" _T(EP_CLSID), L"ExplorerPatcher_GUI_" _T(EP_CLSID),