Skip to main content
added 54 characters in body
Source Link
Timwi
  • 66.8k
  • 34
  • 172
  • 235

Here’s how:

using System.Runtime.InteropServices; 

[DllImport("kernel32.dll")] static extern IntPtr GetConsoleWindow(); [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); const int SW_HIDE = 0; const int SW_SHOW = 5; 

var handle = GetConsoleWindow(); // Hide ShowWindow(handle, SW_HIDE); // Show ShowWindow(handle, SW_SHOW); 

Here’s how:

[DllImport("kernel32.dll")] static extern IntPtr GetConsoleWindow(); [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); const int SW_HIDE = 0; const int SW_SHOW = 5; 

var handle = GetConsoleWindow(); // Hide ShowWindow(handle, SW_HIDE); // Show ShowWindow(handle, SW_SHOW); 

Here’s how:

using System.Runtime.InteropServices; 

[DllImport("kernel32.dll")] static extern IntPtr GetConsoleWindow(); [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); const int SW_HIDE = 0; const int SW_SHOW = 5; 

var handle = GetConsoleWindow(); // Hide ShowWindow(handle, SW_HIDE); // Show ShowWindow(handle, SW_SHOW); 
Source Link
Timwi
  • 66.8k
  • 34
  • 172
  • 235

Here’s how:

[DllImport("kernel32.dll")] static extern IntPtr GetConsoleWindow(); [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); const int SW_HIDE = 0; const int SW_SHOW = 5; 

var handle = GetConsoleWindow(); // Hide ShowWindow(handle, SW_HIDE); // Show ShowWindow(handle, SW_SHOW);