How do I get the handle of a console application’s window April 23, 2023 by Tarik Not sure it works, but you can try that : IntPtr handle = Process.GetCurrentProcess().MainWindowHandle;