Results 1 to 4 of 4

Thread: Console App State [Not Resolved]

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Console App State [Not Resolved]

    I have a Console application that is used to delay the startup of some programs when the computer boots up.

    It works fine.

    The only problem is that it has to stay open until the application has been launched (It uses Threading.Thread.Sleep to wait a certain amount of time). This means that it stays in the start menu and can get in the way.

    Is there any way to hide console applications and/or set their startup window state inside the program (As I may want to control these with parameters)? Or would it be easier to just use a form application and copy the code over?

    Another way to solve this would be to use Task Scheduler to set the program to launch at X seconds in the future, or something that has a similar effect, though I want to keep away from this and have my program rely on as less external programs as possible.

    Edit:
    I'm using VS2008
    Last edited by Slyke; Nov 17th, 2008 at 03:31 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Console App State

    The Console class does have some members that relate to the window, although there's no way to minimise or hide it specifically. You can set the WindowLeft or WindowTop property though, so you can push it offscreen. I'm assuming it would work as I've never actually tried it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: Console App State

    Okay, guess I'll just copy the source code then. Thanks for your advice =).

  4. #4
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Console App State [Not Resolved]

    Go to your Project Properties, Click on the Application tab and change the Application Type to "Windows Application". This will prevent the command windows being shown when your application runs.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width