1 |
//********************************************************************************* |
2 |
// |
3 |
//Title: Terminal Services Window Clipper |
4 |
// |
5 |
//Author: Martin Wickett |
6 |
// |
7 |
//Date: 2004 |
8 |
// |
9 |
//********************************************************************************* |
10 |
|
11 |
#ifndef __CBT_H__ |
12 |
#define __CBT_H__ |
13 |
|
14 |
#include <windows.h> |
15 |
#include "hookdll.h" |
16 |
|
17 |
// |
18 |
// a wrapper class to access the WTSWinClipperdll |
19 |
// |
20 |
class WTSWinClipper |
21 |
{ |
22 |
protected: |
23 |
static HINSTANCE mCbtDllHinst; |
24 |
static SETHOOKS mSetCbtHook; |
25 |
static REMOVEHOOKS mRemoveCbtHook; |
26 |
static GETINSTANCECOUNT mGetInstanceCount; |
27 |
|
28 |
public: |
29 |
static bool Init(); |
30 |
static void Done() |
31 |
{ |
32 |
if (mCbtDllHinst) |
33 |
FreeLibrary(mCbtDllHinst); |
34 |
} |
35 |
|
36 |
static void SetCbtHook() |
37 |
{ |
38 |
if (mCbtDllHinst) |
39 |
mSetCbtHook(); |
40 |
} |
41 |
|
42 |
static void RemoveCbtHook() |
43 |
{ |
44 |
if (mCbtDllHinst) |
45 |
mRemoveCbtHook(); |
46 |
} |
47 |
|
48 |
static int GetInstanceCount() |
49 |
{ |
50 |
if (mCbtDllHinst) |
51 |
return mGetInstanceCount(); |
52 |
else |
53 |
return 0; |
54 |
} |
55 |
}; |
56 |
|
57 |
#endif |