public void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime) { //Only if running if (!running) return; Console.WriteLine(hwnd); if (hwnd == IntPtr.Zero) return; if (!hwnd.IsAllowed()) hwnd.HideWindow(); }
public void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime) { if (OnForegroundWindowChanged != null) { if (hwnd != IntPtr.Zero) { OnForegroundWindowChanged(hwnd); } } //Only if watchdog handling is enabled running if (!running) return; Console.WriteLine(hwnd); if (hwnd == IntPtr.Zero) return; if (!hwnd.IsAllowed()) hwnd.HideWindow(); }