Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Creating conditional windows application

Creating conditional windows application

Scheduled Pinned Locked Moved C#
questionhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fredy
    wrote on last edited by
    #1

    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

    A P 2 Replies Last reply
    0
    • F 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

      A Offline
      A Offline
      Ashok Dhamija
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • F 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

        P Offline
        P Offline
        Patric_J
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups