Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cWindowHook.h
Go to the documentation of this file.
1 //
4 //
5 #ifndef _INC_cWindowHook_H
6 #define _INC_cWindowHook_H
7 #ifndef NO_PRAGMA_ONCE
8 #pragma once
9 #endif
10 
11 #include "../WinAPI/WinTypes.h"
13 
14 #ifdef _WIN32
15 namespace GrayLib
16 {
17  class GRAYLIB_LINK cWindowHook
18  {
22 
23  private:
24  static cArraySortPtrValue<cWindowHook, HWND> sm_aMap; // assume we can't use the GWL_USERDATA.
25 
26  HWND m_hWndHook;
27  WNDPROC m_pOldProc;
28 
29  private:
30  static LRESULT WINAPI WndProc(HWND hWnd, WINMSG_t message, WPARAM wParam, LPARAM lParam);
31 
32  protected:
33  void AttachHook(HWND hWnd);
34  void DetachHook();
35 
37  virtual LRESULT HookWindowProc(WINMSG_t message, WPARAM wParam, LPARAM lParam);
38 
39  public:
40  cWindowHook();
41  virtual ~cWindowHook();
42 
43  HWND get_SortValue() const noexcept // for sm_aMap
44  {
45  return m_hWndHook;
46  }
47  };
48 };
49 #endif
50 #endif
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
UINT WINMSG_t
Supplement _WIN32 "windows.h".
Definition: WinTypes.h:111
Definition: cMesh.h:22