forked from redxu/sihook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sihook.c
53 lines (45 loc) · 1 KB
/
sihook.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <windows.h>
#include "siframe.h"
#include "mdiclient.h"
HWND hwnd_si_frame = NULL;
HWND hwnd_mdi_client = NULL;
HWND hwnd_tab_ctl = NULL;
void HookSI(void)
{
//hook si_frame
hwnd_si_frame = GetSiFrameHwnd();
if(hwnd_si_frame == NULL)
{
OutputDebugString("GetSiFrameHwnd=NULL");
ExitProcess(-1);
}
HookSiFrame();
//hook MDIClient
hwnd_mdi_client = GetMdiClientHwnd(hwnd_si_frame);
if(hwnd_mdi_client == NULL)
{
OutputDebugString("GetMdiClientHwnd=NULL");
ExitProcess(-1);
}
HookMdiClient();
}
void UnhookSI(void)
{
};
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
HookSI();
break;
case DLL_PROCESS_DETACH:
UnhookSI();
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE; // succesful
}