// handles the hook event private void WndProcRetHookInvoked(object sender, HookEventArgs e) { WndProcRetEventArgs wpe = new WndProcRetEventArgs(e.wParam, e.lParam); if ((hWndHooked == IntPtr.Zero || wpe.cw.hwnd == hWndHooked) && WndProcRet != null) { WndProcRet(this, wpe); } return; }
public void WndProcRet(object sender, WndProcRetEventArgs e) { if (e.cw.message == WndMessage.WM_INITDIALOG || e.cw.message == WndMessage.WM_UNKNOWINIT) { USER32.MoveWindow(e.cw.hwnd, rect.Left, rect.Top, rect.Width, rect.Height, 1); // uninstall this hook WindowsHook wndHook = (WindowsHook)sender; Debug.Assert(wndProcRetHook == wndHook); wndProcRetHook.Uninstall(); wndProcRetHook = null; } }
// handles the hook event private void WndProcRetHookInvoked(object sender, HookEventArgs e) { WndProcRetEventArgs wpe = new WndProcRetEventArgs(e.wParam, e.lParam); if ((hWndHooked == IntPtr.Zero || wpe.cw.hwnd == hWndHooked) && WndProcRet != null) WndProcRet(this, wpe); return; }