Beispiel #1
0
        public static void ShowConsole()
        {
            var handle = PInvokes.GetConsoleWindow();

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

            PInvokes.ShowWindowAsync(handle, PInvokes.SW.Show);
        }
Beispiel #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);
        }
Beispiel #3
0
 public static void Show(IntPtr hWnd)
 {
     PInvokes.ShowWindowAsync(hWnd, PInvokes.SW.Show);
     PInvokes.SetForegroundWindow(hWnd);
 }
Beispiel #4
0
 public IWindow Show(IntPtr hWnd)
 {
     PInvokes.ShowWindowAsync(hWnd, PInvokes.SW.Show);
     PInvokes.SetForegroundWindow(hWnd);
     return(new Window(hWnd));
 }
Beispiel #5
0
        public static void HideConsole()
        {
            var handle = PInvokes.GetConsoleWindow();

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