protected virtual void OnWindowEvent(IntPtr hWnd, Interop.ShellEvents shell) { var handler = WindowEvent; if (handler != null) { handler(this, hWnd, shell); } }
private void systemProcessHook_WindowEvent(object sender, IntPtr handle, Interop.ShellEvents shell) { if (shell == Interop.ShellEvents.HSHELL_WINDOWDESTROYED) { if (altTabList.Remove(handle)) { Console.WriteLine("hwnd:{0}, title:{1} removed. altTabList cound ={2}", handle.ToString(), WowDisableWinKeyTools.GetWindowTitle(handle), altTabList.Count.ToString()); } } if (shell == Interop.ShellEvents.HSHELL_WINDOWCREATED && OpenWindowGetter.KeepWindowHandleInAltTabList(handle)) { altTabList.Insert(0, handle); Console.WriteLine("hwnd:{0}, title:{1} inserted. altTabList cound ={2}", handle.ToString(), WowDisableWinKeyTools.GetWindowTitle(handle), altTabList.Count.ToString()); tabOrWindow = SwitchTo.Window; } }
public WinHookEventArgs(Interop.ShellEvents t, string w) { type = t; wName = w; }