• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

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


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
1 Solution
See Process.WaitForInputIdle Method.

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now