コード例 #1
0
ファイル: NTMinerConsole.cs プロジェクト: wind959/ntminer
        public static void Hide()
        {
            IntPtr console = SafeNativeMethods.GetConsoleWindow();

            if (console != IntPtr.Zero)
            {
                SafeNativeMethods.ShowWindow(console, 0);
            }
        }
コード例 #2
0
ファイル: NTMinerConsole.cs プロジェクト: wind959/ntminer
        public static IntPtr Show()
        {
            IntPtr console = SafeNativeMethods.GetConsoleWindow();

            if (console != IntPtr.Zero)
            {
                SafeNativeMethods.ShowWindow(console, 1);
            }
            return(console);
        }
コード例 #3
0
ファイル: NTMinerConsole.cs プロジェクト: UcAspNet/ntminer
        public static IntPtr Alloc()
        {
            IntPtr console = SafeNativeMethods.GetConsoleWindow();

            if (console == IntPtr.Zero)
            {
                SafeNativeMethods.AllocConsole();
                DisbleQuickEditMode();
                console = SafeNativeMethods.GetConsoleWindow();
                SafeNativeMethods.ShowWindow(console, 0);
            }
            return(console);
        }
コード例 #4
0
ファイル: NTMinerConsole.cs プロジェクト: UcAspNet/ntminer
        public static void Hide()
        {
            if (_isHided)
            {
                return;
            }
            _isHided = true;
            IntPtr console = SafeNativeMethods.GetConsoleWindow();

            if (console != IntPtr.Zero)
            {
                SafeNativeMethods.ShowWindow(console, 0);
            }
        }
コード例 #5
0
 public static void InitOnece(bool isForce = false, bool initHide = false)
 {
     if (!isForce && !_isEnabled)
     {
         return;
     }
     if (!_isInited)
     {
         lock (_locker) {
             if (!_isInited)
             {
                 _isInited = true;
                 var hWnh = GetOrAlloc();
                 if (initHide)
                 {
                     SafeNativeMethods.ShowWindow(hWnh, 0);
                 }
             }
         }
     }
 }