Пример #1
0
        public static void ShowConsole()
        {
            var handle = PInvokes.GetConsoleWindow();

            if (handle == IntPtr.Zero)
            {
                PInvokes.AllocConsole();
                return;
            }

            PInvokes.ShowWindowAsync(handle, PInvokes.SW.Show);
        }
Пример #2
0
        public static void InitialConsole(bool disableCloseButton = false)
        {
            PInvokes.AllocConsole();
            var handle = PInvokes.GetConsoleWindow();

#if !DEBUG
            PInvokes.ShowWindowAsync(handle, PInvokes.SW.Hide);
            if (disableCloseButton)
            {
                DisableCloseButton();
            }
#endif
            SetConsoleCtrlHandler(handlerDelegate, true);
        }
Пример #3
0
 public static void Show(IntPtr hWnd)
 {
     PInvokes.ShowWindowAsync(hWnd, PInvokes.SW.Show);
     PInvokes.SetForegroundWindow(hWnd);
 }
Пример #4
0
 public IWindow Show(IntPtr hWnd)
 {
     PInvokes.ShowWindowAsync(hWnd, PInvokes.SW.Show);
     PInvokes.SetForegroundWindow(hWnd);
     return(new Window(hWnd));
 }
Пример #5
0
        public static void HideConsole()
        {
            var handle = PInvokes.GetConsoleWindow();

            PInvokes.ShowWindowAsync(handle, PInvokes.SW.Hide);
        }