//----------------------------------------------------------------------------- //Spying Process functions follow //----------------------------------------------------------------------------- void Desktop::EnableHook(IntPtr windowHandle) { HINSTANCE hinstDLL; hinstDLL = LoadLibrary((LPCTSTR) _T("ManagedSpyLib.dll")); DisableHook(); DWORD tid = GetWindowThreadProcessId((HWND)windowHandle.ToPointer(), NULL); _messageHookHandle = SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC)GetProcAddress(hinstDLL, "MessageHookProc"), hinstDLL, tid); }
bool CFidgetApp::Finalize(void) { m_pMainFrame = NULL; DisableHook(); if (NULL != m_hRichEdit) { ::FreeLibrary(m_hRichEdit); m_hRichEdit = NULL; } UnregisterClasses(); return true; }