Creating conditional windows application
-
Hi I want to make a windows application conditional in following way: If I start the application without parameters, then it should start as a windows application If I start it with parameters, it should run as a console application. Currently I solved it by creating a console application and check the input parameters. If no parameters are given, it starts a windows.forms class. This works perfectly - almost. The problem is, that if it runs as a windows application, it starts also a dos box, which I would like to have prevented. Now the question is: How can I start the windows application conditional without the dos box? Thanks Fredy
-
Hi I want to make a windows application conditional in following way: If I start the application without parameters, then it should start as a windows application If I start it with parameters, it should run as a console application. Currently I solved it by creating a console application and check the input parameters. If no parameters are given, it starts a windows.forms class. This works perfectly - almost. The problem is, that if it runs as a windows application, it starts also a dos box, which I would like to have prevented. Now the question is: How can I start the windows application conditional without the dos box? Thanks Fredy
One simple solution may be like this: 1. Make a skelton wrapper application (which should preferrably be a console application), which should have a very simple main method to call or execute the relevant application. 2. So, in the wrapper application's main method, check for parameters and start the windows application or the console application, as the case may be. 3. Immediately after the second step, the skelton wrapper application may exit. Although there may be some better methods, but this simple solution may work too. Regards, Ashok Dhamija _____________________________ Padam Technologies
-
Hi I want to make a windows application conditional in following way: If I start the application without parameters, then it should start as a windows application If I start it with parameters, it should run as a console application. Currently I solved it by creating a console application and check the input parameters. If no parameters are given, it starts a windows.forms class. This works perfectly - almost. The problem is, that if it runs as a windows application, it starts also a dos box, which I would like to have prevented. Now the question is: How can I start the windows application conditional without the dos box? Thanks Fredy
Check Paul DiLascia MSDN Magazine column where he discusses this, unfortunately for you its C++ but still its a good article about the problem: Color Support, Console Apps, and Saving User Settings -- MSDN Magazine, February 2004 /Patric My C# blog: C# Coach