How do you Shell a program & wait for it to open?

Posted on 2006-03-30
Last Modified: 2010-04-23

My program launches a game. At the moment Im using the sleep api to make my program wait for a while after launcing the game.

The problem I have is that the game doesn't always take the same amount of time to load, and may take longer on another computer.

Is there a way to launch the game and make the program wait until the game window is open?
Another part of the problem is that if the cd isn't in the drive it gives a message saying to insert it with 'Retry' and 'Cancel' buttons. I need my program to be able to close this message and then close itself.

Thanks In Advance
Question by:mms_master
    1 Comment
    LVL 48

    Accepted Solution

    See Process.WaitForInputIdle Method.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video discusses moving either the default database or any database to a new volume.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now