MCPcopy Create free account
hub / github.com/audiorouterdev/audio-router / InstallHook

Method InstallHook

audio-router-gui/DialogMessageHook.cpp:85–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83extern CAppModule _Module;
84
85HRESULT CDialogMessageHook::InstallHook(HWND hWnd)
86{
87 // make sure the hook is installed
88 if (m_hHook == NULL)
89 {
90 m_hHook = ::SetWindowsHookEx(WH_GETMESSAGE,
91 GetMessageProc,
92 _Module.m_hInst,
93 GetCurrentThreadId());
94
95 // is the hook set?
96 if (m_hHook == NULL)
97 {
98 return E_UNEXPECTED;
99 }
100 }
101
102 // add the window to our list of managed windows
103 if (m_aWindows.find(hWnd) == m_aWindows.end())
104 m_aWindows.insert(hWnd);
105
106 return S_OK;
107}
108
109HRESULT CDialogMessageHook::UninstallHook(HWND hWnd)
110{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected