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

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

            PInvokes.ShowWindowAsync(handle, PInvokes.SW.Show);
        }
Exemple #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);
        }