mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
hook GetTopWindow
This commit is contained in:
parent
2ccda7875d
commit
ab773f6469
@ -9,7 +9,7 @@
|
||||
#define SKIP_HOOK3 0x00000002l
|
||||
|
||||
typedef struct HOOKLISTDATA { char function_name[32]; PROC new_function; PROC* function; DWORD flags; } HOOKLISTDATA;
|
||||
typedef struct HOOKLIST { char module_name[32]; HOOKLISTDATA data[24]; } HOOKLIST;
|
||||
typedef struct HOOKLIST { char module_name[32]; HOOKLISTDATA data[25]; } HOOKLIST;
|
||||
|
||||
typedef BOOL(WINAPI* GETCURSORPOSPROC)(LPPOINT);
|
||||
typedef BOOL(WINAPI* CLIPCURSORPROC)(const RECT*);
|
||||
@ -34,6 +34,7 @@ typedef HWND(WINAPI* CREATEWINDOWEXAPROC)(DWORD, LPCSTR, LPCSTR, DWORD, int, int
|
||||
typedef BOOL(WINAPI* DESTROYWINDOWPROC)(HWND);
|
||||
typedef int (WINAPI* MAPWINDOWPOINTSPROC)(HWND, HWND, LPPOINT, UINT);
|
||||
typedef BOOL (WINAPI* SHOWWINDOWPROC)(HWND, int);
|
||||
typedef HWND(WINAPI* GETTOPWINDOWPROC)(HWND);
|
||||
typedef BOOL(WINAPI* STRETCHBLTPROC)(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);
|
||||
|
||||
typedef int (WINAPI* SETDIBITSTODEVICEPROC)(
|
||||
@ -74,6 +75,7 @@ extern CREATEWINDOWEXAPROC real_CreateWindowExA;
|
||||
extern DESTROYWINDOWPROC real_DestroyWindow;
|
||||
extern MAPWINDOWPOINTSPROC real_MapWindowPoints;
|
||||
extern SHOWWINDOWPROC real_ShowWindow;
|
||||
extern GETTOPWINDOWPROC real_GetTopWindow;
|
||||
extern STRETCHBLTPROC real_StretchBlt;
|
||||
extern SETDIBITSTODEVICEPROC real_SetDIBitsToDevice;
|
||||
extern STRETCHDIBITSPROC real_StretchDIBits;
|
||||
|
@ -27,6 +27,7 @@ BOOL WINAPI fake_EnableWindow(HWND hWnd, BOOL bEnable);
|
||||
BOOL WINAPI fake_DestroyWindow(HWND hWnd);
|
||||
int WINAPI fake_MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints);
|
||||
BOOL WINAPI fake_ShowWindow(HWND hWnd, int nCmdShow);
|
||||
HWND WINAPI fake_GetTopWindow(HWND hWnd);
|
||||
HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId);
|
||||
int WINAPI fake_GetDeviceCaps(HDC hdc, int index);
|
||||
|
||||
|
@ -40,6 +40,7 @@ CREATEWINDOWEXAPROC real_CreateWindowExA = CreateWindowExA;
|
||||
DESTROYWINDOWPROC real_DestroyWindow = DestroyWindow;
|
||||
MAPWINDOWPOINTSPROC real_MapWindowPoints = MapWindowPoints;
|
||||
SHOWWINDOWPROC real_ShowWindow = ShowWindow;
|
||||
GETTOPWINDOWPROC real_GetTopWindow = GetTopWindow;
|
||||
STRETCHBLTPROC real_StretchBlt = StretchBlt;
|
||||
SETDIBITSTODEVICEPROC real_SetDIBitsToDevice = SetDIBitsToDevice;
|
||||
STRETCHDIBITSPROC real_StretchDIBits = StretchDIBits;
|
||||
@ -80,6 +81,7 @@ static HOOKLIST g_hooks[] =
|
||||
{ "DestroyWindow", (PROC)fake_DestroyWindow, (PROC*)&real_DestroyWindow, 0 },
|
||||
{ "MapWindowPoints", (PROC)fake_MapWindowPoints, (PROC*)&real_MapWindowPoints, 0 },
|
||||
{ "ShowWindow", (PROC)fake_ShowWindow, (PROC*)&real_ShowWindow, 0 },
|
||||
{ "GetTopWindow", (PROC)fake_GetTopWindow, (PROC*)&real_GetTopWindow, 0 },
|
||||
{ "", NULL, NULL, 0 }
|
||||
}
|
||||
},
|
||||
|
@ -517,6 +517,16 @@ BOOL WINAPI fake_ShowWindow(HWND hWnd, int nCmdShow)
|
||||
return real_ShowWindow(hWnd, nCmdShow);
|
||||
}
|
||||
|
||||
HWND WINAPI fake_GetTopWindow(HWND hWnd)
|
||||
{
|
||||
if (g_ddraw && g_ddraw->windowed && g_ddraw->hwnd && !hWnd)
|
||||
{
|
||||
return g_ddraw->hwnd;
|
||||
}
|
||||
|
||||
return real_GetTopWindow(hWnd);
|
||||
}
|
||||
|
||||
HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId)
|
||||
{
|
||||
if (idHook == WH_KEYBOARD_LL && hmod && GetModuleHandle("AcGenral") == hmod)
|
||||
|
Loading…
x
Reference in New Issue
Block a user