using System.Diagnostics;
using System.Runtime.InteropServices;
int SW_MINIMIZE = 0;
long WinMinHandle = 0;
[DllImport("user32.dll")]
static extern int ShowWindow(IntPtr handle, int command);
var p = Process.GetCurrentProcess();
WinMinHandle = ShowWindow(p.MainWindowHandle, SW_MINIMIZE);
More than 1 year has passed since last update.
【C#】コンソールアプリケーション起動時にアプリケーションのウィンドウを非表示にしたい
Last updated at Posted at 2022-08-14
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme