| 83 | extern CAppModule _Module; |
| 84 | |
| 85 | HRESULT 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 | |
| 109 | HRESULT CDialogMessageHook::UninstallHook(HWND hWnd) |
| 110 | { |
nothing calls this directly
no outgoing calls
no test coverage detected