public ForegroundWatchDog()
 {
     if (this.dele == null)
     {
         this.dele = new ForegroundWatchDog.WinEventDelegate(this.WinEventProc);
     }
     ForegroundWatchDog.SetWinEventHook(3U, 3U, IntPtr.Zero, this.dele, 0U, 0U, 0U);
     ForegroundWatchDog.SetWinEventHook(8U, 8U, IntPtr.Zero, this.dele, 0U, 0U, 0U);
 }
 private static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, ForegroundWatchDog.WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags);