Windows form launching a console application
I have a C# console application that is launched from a WinForm application.
The output of the console application is well-formatted; however, user can run the console application directly. Is there a way to restrict/force the console application to be only run from the main application (WinForm)?
Re: Windows form launching a console application
Use a named mutex. Create the mutex in the windows app before you launch the console app. When the console app starts up, try to open the mutex. It should open. If the mutex doesn't exist and the console app can't open it, you can assume the console app wasn't launched by the windows app.