hook GetWindowPlacement
This commit is contained in:
parent
7f0b122e29
commit
f5e0e95490
4 changed files with 34 additions and 2 deletions
|
@ -49,6 +49,7 @@ SETFOREGROUNDWINDOWPROC real_SetForegroundWindow = SetForegroundWindow;
|
|||
SETWINDOWSHOOKEXAPROC real_SetWindowsHookExA = SetWindowsHookExA;
|
||||
PEEKMESSAGEAPROC real_PeekMessageA = PeekMessageA;
|
||||
GETMESSAGEAPROC real_GetMessageA = GetMessageA;
|
||||
GETWINDOWPLACEMENTPROC real_GetWindowPlacement = GetWindowPlacement;
|
||||
GETKEYSTATEPROC real_GetKeyState = GetKeyState;
|
||||
GETASYNCKEYSTATEPROC real_GetAsyncKeyState = GetAsyncKeyState;
|
||||
GETDEVICECAPSPROC real_GetDeviceCaps = GetDeviceCaps;
|
||||
|
@ -95,6 +96,7 @@ HOOKLIST g_hook_hooklist[] =
|
|||
{ "GetForegroundWindow", (PROC)fake_GetForegroundWindow, (PROC*)&real_GetForegroundWindow, 0 },
|
||||
{ "PeekMessageA", (PROC)fake_PeekMessageA, (PROC*)&real_PeekMessageA, 0 },
|
||||
{ "GetMessageA", (PROC)fake_GetMessageA, (PROC*)&real_GetMessageA, 0 },
|
||||
{ "GetWindowPlacement", (PROC)fake_GetWindowPlacement, (PROC*)&real_GetWindowPlacement, 0 },
|
||||
{ "GetKeyState", (PROC)fake_GetKeyState, (PROC*)&real_GetKeyState, 0 },
|
||||
{ "GetAsyncKeyState", (PROC)fake_GetAsyncKeyState, (PROC*)&real_GetAsyncKeyState, 0 },
|
||||
{ "SetForegroundWindow", (PROC)fake_SetForegroundWindow, (PROC*)&real_SetForegroundWindow, 0 },
|
||||
|
|
|
@ -732,6 +732,33 @@ BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT w
|
|||
return result;
|
||||
}
|
||||
|
||||
BOOL WINAPI fake_GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT* lpwndpl)
|
||||
{
|
||||
BOOL result = real_GetWindowPlacement(hWnd, lpwndpl);
|
||||
|
||||
if (result &&
|
||||
lpwndpl &&
|
||||
g_ddraw.ref &&
|
||||
g_ddraw.hwnd &&
|
||||
g_ddraw.width &&
|
||||
(g_config.hook != 2 || g_ddraw.renderer == gdi_render_main))
|
||||
{
|
||||
if (hWnd == g_ddraw.hwnd || hWnd == GetDesktopWindow())
|
||||
{
|
||||
lpwndpl->rcNormalPosition.bottom = g_ddraw.height;
|
||||
lpwndpl->rcNormalPosition.left = 0;
|
||||
lpwndpl->rcNormalPosition.right = g_ddraw.width;
|
||||
lpwndpl->rcNormalPosition.top = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
real_MapWindowPoints(HWND_DESKTOP, g_ddraw.hwnd, (LPPOINT)&lpwndpl->rcNormalPosition, 2);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SHORT WINAPI fake_GetKeyState(int nVirtKey)
|
||||
{
|
||||
if (g_config.windowed && g_ddraw.ref && g_ddraw.hwnd && !util_in_foreground())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue