QuakeConsole.QuakeTerminal.WinEventProc C# (CSharp) Method

WinEventProc() public method

public WinEventProc ( IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime ) : void
hWinEventHook System.IntPtr
eventType uint
hwnd System.IntPtr
idObject int
idChild int
dwEventThread uint
dwmsEventTime uint
return void
        void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
        {
            // if we got the EVENT_SYSTEM_FOREGROUND, and the hwnd is the putty terminal hwnd (m_AppWin)
            // then bring the supperputty window to the foreground
            bool isThis = (hwnd == ChildHandle);
            if (eventType == EVENT_SYSTEM_FOREGROUND)
            {
                HasFocus = (GetForegroundWindow() == ChildHandle);
            }
            else if (isThis && eventType == EVENT_OBJECT_NAMECHANGE)
            {
                SetCaptionFromTerminal();
            }
        }