Пример #1
0
        public static void Hide()
        {
            IntPtr console = SafeNativeMethods.GetConsoleWindow();

            if (console != IntPtr.Zero)
            {
                SafeNativeMethods.ShowWindow(console, 0);
            }
        }
Пример #2
0
        public static void Free()
        {
            IntPtr console = SafeNativeMethods.GetConsoleWindow();

            if (console != IntPtr.Zero)
            {
                SafeNativeMethods.FreeConsole();
            }
        }
Пример #3
0
        public static IntPtr Show()
        {
            IntPtr console = SafeNativeMethods.GetConsoleWindow();

            if (console != IntPtr.Zero)
            {
                SafeNativeMethods.ShowWindow(console, 1);
            }
            return(console);
        }
Пример #4
0
        public static IntPtr Alloc()
        {
            IntPtr console = SafeNativeMethods.GetConsoleWindow();

            if (console == IntPtr.Zero)
            {
                SafeNativeMethods.AllocConsole();
                DisbleQuickEditMode();
                console = SafeNativeMethods.GetConsoleWindow();
                SafeNativeMethods.ShowWindow(console, 0);
            }
            return(console);
        }
Пример #5
0
        public static void Hide()
        {
            if (_isHided)
            {
                return;
            }
            _isHided = true;
            IntPtr console = SafeNativeMethods.GetConsoleWindow();

            if (console != IntPtr.Zero)
            {
                SafeNativeMethods.ShowWindow(console, 0);
            }
        }
Пример #6
0
 public static IntPtr GetIntPtr()
 {
     return(SafeNativeMethods.GetConsoleWindow());
 }
Пример #7
0
 public static void MoveWindow(int x, int y, int nWidth, int nHeight, bool bRepaint)
 {
     SafeNativeMethods.MoveWindow(SafeNativeMethods.GetConsoleWindow(), x, y, nWidth, nHeight, bRepaint);
 }