Example #1
0
            /// <summary>
            /// Активация окна
            /// </summary>
            private static void SwitchToCurrentInstance(IntPtr hWnd)
            {
                if (hWnd != IntPtr.Zero)
                {
                    // Restore window if minimised. Do not restore if already in
                    // normal or maximised window state, since we don't want to
                    // change the current state of the window.
                    if (WinApi.IsIconic(hWnd) != 0)
                    {
                        WinApi.ShowWindow(hWnd, WinApi.SW_RESTORE);
                    }
                    else
                    {
                        ;
                    }

                    // Set foreground window.
                    WinApi.SetForegroundWindow(hWnd);
                }
            }