Exemple #1
0
 public static void ShowConsoleWindow()
 {
     if (ConsoleWindowHandle != IntPtr.Zero)
     {
         ChoUser32.ShowWindow(ConsoleWindowHandle, (int)SHOWWINDOW.SW_SHOWNORMAL); //1 = SW_HIDE
     }
 }
Exemple #2
0
 /// <summary>
 /// If the process has a console attached to it, it will be detached and no longer visible. Writing to the System.Console is still possible, but no output will be shown.
 /// </summary>
 public static void Hide()
 {
     if (HasWindow)
     {
         ChoUser32.ShowWindow(MainWindowHandle, (int)SHOWWINDOW.SW_HIDE); //1 = SW_HIDE
     }
 }
Exemple #3
0
 public static void ShowInTaskbar(bool show)
 {
     if (HasWindow)
     {
         if (!show)
         {
             if (_show)
             {
                 _show = false;
                 Hide();
                 ChoUser32.SetWindowLong(MainWindowHandle, (int)GwlIndexEnum.GWL_EXSTYLE, (int)((WindowStyles)_origExWindowStyle | WindowStyles.WS_EX_TOOLWINDOW));
                 ChoUser32.ShowWindow(MainWindowHandle, (int)SHOWWINDOW.SW_SHOWNA);
             }
         }
         else
         {
             if (!_show)
             {
                 _show = true;
                 Hide();
                 ChoUser32.SetWindowLong(MainWindowHandle, (int)GwlIndexEnum.GWL_EXSTYLE, (int)_origExWindowStyle);
                 ChoUser32.ShowWindow(MainWindowHandle, (int)SHOWWINDOW.SW_SHOWNA);
             }
         }
     }
 }
 /// <summary>
 /// Creates a new console instance if the process is not attached to a console already.
 /// </summary>
 public static void Show()
 {
     if (HasWindow)
     {
         ChoUser32.ShowWindow(MainWindowHandle, (int)SHOWWINDOW.SW_SHOWNORMAL); //1 = SW_SHOWNORMA
     }
 }
Exemple #5
0
 /// <summary>
 /// Creates a new console instance if the process is not attached to a console already.
 /// </summary>
 public static void Show()
 {
     if (HasWindow)
     {
         ChoUser32.ShowWindow(MainWindowHandle, (int)SHOWWINDOW.SW_SHOWNORMAL); //1 = SW_SHOWNORMA
         ChoWindowsManager.SetTop();
     }
 }