I've got some code that runs an executable (args.FileName) and at the same time launches a console window for that process:
var process = new Process
{
StartInfo = new ProcessStartInfo(args.FileName, args.Arguments)
{
RedirectStandardOutput = false,
RedirectStandardError = false,
UseShellExecute = true,
CreateNoWindow = false,
WindowStyle = ProcessWindowStyle.Normal
}
};
2 separate processes should be launched using this (both using args.FileName). I'm in the process of making this configurable so that the console window is launched and visible or not depending on configuration. However, how can I test that the console window has been launched or not (presumably on a separate process)? When I check the process id it's the id of the application that's been launched ( args.FileName - as expected) not the console window.