-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// ==WindhawkMod== | ||
// @id legacy-alt-tab | ||
// @name Legacy Alt+Tab dialog | ||
// @description Enables legacy Alt+Tab dialog from Windows XP and Windows 2000 | ||
// @version 1.0 | ||
// @author Anixx | ||
// @github https://github.com/Anixx | ||
// @include explorer.exe | ||
// ==/WindhawkMod== | ||
|
||
// ==WindhawkModReadme== | ||
/* | ||
Enables legacy Alt+Tab dialog from Windows XP and Windows 2000 | ||
*/ | ||
// ==/WindhawkModReadme== | ||
|
||
#include <windows.h> | ||
|
||
typedef LONG (WINAPI *REGQUERYVALUEEXW)(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); | ||
|
||
REGQUERYVALUEEXW pOriginalRegQueryValueExW; | ||
|
||
LONG WINAPI RegQueryValueExWHook(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) | ||
{ | ||
|
||
if (lstrcmpiW(lpValueName, L"AltTabSettings") == 0) | ||
|
||
{ | ||
if (lpType) | ||
*lpType = REG_DWORD; | ||
if (lpData && lpcbData && *lpcbData >= sizeof(DWORD)) | ||
{ | ||
*(DWORD*)lpData = 1; | ||
*lpcbData = sizeof(DWORD); | ||
} | ||
return ERROR_SUCCESS; | ||
} | ||
|
||
return pOriginalRegQueryValueExW(hKey, lpValueName, lpReserved, lpType, lpData, lpcbData); | ||
} | ||
|
||
BOOL Wh_ModInit(void) | ||
{ | ||
Wh_Log(L"Init"); | ||
|
||
Wh_SetFunctionHook((void*)GetProcAddress(LoadLibrary(L"kernelbase.dll"), "RegQueryValueExW"), (void*)RegQueryValueExWHook, (void**)&pOriginalRegQueryValueExW); | ||
|
||
return TRUE; | ||
} |