mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-25 01:57:47 +01:00
hook SetForegroundWindow for profile links
This commit is contained in:
parent
f86ad29835
commit
766e4b434c
@ -9,7 +9,7 @@
|
|||||||
#define SKIP_HOOK3 0x00000002l
|
#define SKIP_HOOK3 0x00000002l
|
||||||
|
|
||||||
typedef struct HOOKLISTDATA { char function_name[32]; PROC new_function; PROC* function; DWORD flags; } HOOKLISTDATA;
|
typedef struct HOOKLISTDATA { char function_name[32]; PROC new_function; PROC* function; DWORD flags; } HOOKLISTDATA;
|
||||||
typedef struct HOOKLIST { char module_name[32]; HOOKLISTDATA data[27]; } HOOKLIST;
|
typedef struct HOOKLIST { char module_name[32]; HOOKLISTDATA data[28]; } HOOKLIST;
|
||||||
|
|
||||||
typedef BOOL(WINAPI* GETCURSORPOSPROC)(LPPOINT);
|
typedef BOOL(WINAPI* GETCURSORPOSPROC)(LPPOINT);
|
||||||
typedef BOOL(WINAPI* CLIPCURSORPROC)(const RECT*);
|
typedef BOOL(WINAPI* CLIPCURSORPROC)(const RECT*);
|
||||||
@ -44,6 +44,7 @@ typedef int (WINAPI* SETDIBITSTODEVICEPROC)(
|
|||||||
typedef int (WINAPI* STRETCHDIBITSPROC)(
|
typedef int (WINAPI* STRETCHDIBITSPROC)(
|
||||||
HDC, int, int, int, int, int, int, int, int, const VOID*, const BITMAPINFO*, UINT, DWORD);
|
HDC, int, int, int, int, int, int, int, int, const VOID*, const BITMAPINFO*, UINT, DWORD);
|
||||||
|
|
||||||
|
typedef BOOL (WINAPI* SETFOREGROUNDWINDOWPROC)(HWND hWnd);
|
||||||
typedef HHOOK(WINAPI* SETWINDOWSHOOKEXAPROC)(int, HOOKPROC, HINSTANCE, DWORD);
|
typedef HHOOK(WINAPI* SETWINDOWSHOOKEXAPROC)(int, HOOKPROC, HINSTANCE, DWORD);
|
||||||
typedef BOOL(WINAPI* PEEKMESSAGEAPROC)(LPMSG, HWND, UINT, UINT, UINT);
|
typedef BOOL(WINAPI* PEEKMESSAGEAPROC)(LPMSG, HWND, UINT, UINT, UINT);
|
||||||
|
|
||||||
@ -85,6 +86,7 @@ extern GETFOREGROUNDWINDOWPROC real_GetForegroundWindow;
|
|||||||
extern STRETCHBLTPROC real_StretchBlt;
|
extern STRETCHBLTPROC real_StretchBlt;
|
||||||
extern SETDIBITSTODEVICEPROC real_SetDIBitsToDevice;
|
extern SETDIBITSTODEVICEPROC real_SetDIBitsToDevice;
|
||||||
extern STRETCHDIBITSPROC real_StretchDIBits;
|
extern STRETCHDIBITSPROC real_StretchDIBits;
|
||||||
|
extern SETFOREGROUNDWINDOWPROC real_SetForegroundWindow;
|
||||||
extern SETWINDOWSHOOKEXAPROC real_SetWindowsHookExA;
|
extern SETWINDOWSHOOKEXAPROC real_SetWindowsHookExA;
|
||||||
extern PEEKMESSAGEAPROC real_PeekMessageA;
|
extern PEEKMESSAGEAPROC real_PeekMessageA;
|
||||||
extern GETDEVICECAPSPROC real_GetDeviceCaps;
|
extern GETDEVICECAPSPROC real_GetDeviceCaps;
|
||||||
|
@ -29,6 +29,7 @@ int WINAPI fake_MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UI
|
|||||||
BOOL WINAPI fake_ShowWindow(HWND hWnd, int nCmdShow);
|
BOOL WINAPI fake_ShowWindow(HWND hWnd, int nCmdShow);
|
||||||
HWND WINAPI fake_GetTopWindow(HWND hWnd);
|
HWND WINAPI fake_GetTopWindow(HWND hWnd);
|
||||||
HWND WINAPI fake_GetForegroundWindow(void);
|
HWND WINAPI fake_GetForegroundWindow(void);
|
||||||
|
BOOL WINAPI fake_SetForegroundWindow(HWND hWnd);
|
||||||
HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId);
|
HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId);
|
||||||
BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg);
|
BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg);
|
||||||
int WINAPI fake_GetDeviceCaps(HDC hdc, int index);
|
int WINAPI fake_GetDeviceCaps(HDC hdc, int index);
|
||||||
|
@ -45,6 +45,7 @@ GETFOREGROUNDWINDOWPROC real_GetForegroundWindow = GetForegroundWindow;
|
|||||||
STRETCHBLTPROC real_StretchBlt = StretchBlt;
|
STRETCHBLTPROC real_StretchBlt = StretchBlt;
|
||||||
SETDIBITSTODEVICEPROC real_SetDIBitsToDevice = SetDIBitsToDevice;
|
SETDIBITSTODEVICEPROC real_SetDIBitsToDevice = SetDIBitsToDevice;
|
||||||
STRETCHDIBITSPROC real_StretchDIBits = StretchDIBits;
|
STRETCHDIBITSPROC real_StretchDIBits = StretchDIBits;
|
||||||
|
SETFOREGROUNDWINDOWPROC real_SetForegroundWindow = SetForegroundWindow;
|
||||||
SETWINDOWSHOOKEXAPROC real_SetWindowsHookExA = SetWindowsHookExA;
|
SETWINDOWSHOOKEXAPROC real_SetWindowsHookExA = SetWindowsHookExA;
|
||||||
PEEKMESSAGEAPROC real_PeekMessageA = PeekMessageA;
|
PEEKMESSAGEAPROC real_PeekMessageA = PeekMessageA;
|
||||||
GETDEVICECAPSPROC real_GetDeviceCaps = GetDeviceCaps;
|
GETDEVICECAPSPROC real_GetDeviceCaps = GetDeviceCaps;
|
||||||
@ -87,6 +88,7 @@ static HOOKLIST g_hooks[] =
|
|||||||
{ "GetTopWindow", (PROC)fake_GetTopWindow, (PROC*)&real_GetTopWindow, 0 },
|
{ "GetTopWindow", (PROC)fake_GetTopWindow, (PROC*)&real_GetTopWindow, 0 },
|
||||||
{ "GetForegroundWindow", (PROC)fake_GetForegroundWindow, (PROC*)&real_GetForegroundWindow, 0 },
|
{ "GetForegroundWindow", (PROC)fake_GetForegroundWindow, (PROC*)&real_GetForegroundWindow, 0 },
|
||||||
{ "PeekMessageA", (PROC)fake_PeekMessageA, (PROC*)&real_PeekMessageA, 0 },
|
{ "PeekMessageA", (PROC)fake_PeekMessageA, (PROC*)&real_PeekMessageA, 0 },
|
||||||
|
{ "SetForegroundWindow", (PROC)fake_SetForegroundWindow, (PROC*)&real_SetForegroundWindow, 0 },
|
||||||
{ "", NULL, NULL, 0 }
|
{ "", NULL, NULL, 0 }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -558,6 +558,16 @@ HWND WINAPI fake_GetForegroundWindow()
|
|||||||
return real_GetForegroundWindow();
|
return real_GetForegroundWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI fake_SetForegroundWindow(HWND hWnd)
|
||||||
|
{
|
||||||
|
if (g_ddraw && g_ddraw->bnet_active)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return real_SetForegroundWindow(hWnd);
|
||||||
|
}
|
||||||
|
|
||||||
HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId)
|
HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId)
|
||||||
{
|
{
|
||||||
if (idHook == WH_KEYBOARD_LL && hmod && GetModuleHandle("AcGenral") == hmod)
|
if (idHook == WH_KEYBOARD_LL && hmod && GetModuleHandle("AcGenral") == hmod)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user