glavian

Hi,
Does anyone know of a way to catch if a CD-Auto Launch is kicked off and not allow that window to become the foreground window. In my game I would like to keep my Windows app as the foreground window. I'm only looking to do this in the case of a CD-Auto Launch happening.

Thanks in advance.


Re: Game Technologies: General Catching Auto-CD launch window message in a game

Glenn Wilson

To do this you might have to tap into the WMI Events for the CD or Drive system, I do not know the exact classes in WMI but it would be where I would start.






Re: Game Technologies: General Catching Auto-CD launch window message in a game

Wessam Bahnassi

You don't. There used to be a way to disable auto-run while your game is running, but it's bad and incompatible with the new Windows security features. And after all, I don't think users will appreciate you doing this...




Re: Game Technologies: General Catching Auto-CD launch window message in a game

Jstn

Hrm¡­ That just doesn't seem right to me.

Obviously there is a way to do it, as many installers prompt you for the next disc in a series, then keep on chuggin¡¯ after you insert it. (As opposed to letting the auto-play feature pop up and ask you what you want to do about the disc...)

Granted that most games now install the whole of themselves onto the users hard drive, but lets say theoretically that the game is massive (3 DVD9s or so) and the user opts not to waste all that HD space. (And this is possible... I just uninstalled a certain game from Sigil/SOE because they decided they needed 20GBs on my 60GB drive... WTF !) Are you suggesting that when the game prompts the player to insert the next disc, that the game experience should be destroyed because Windows desperately need to know what you want to do with the disc you just loaded into the drive, and the game cannot tell Windows to "chill out, I'm expecting this" because of security "features"





Re: Game Technologies: General Catching Auto-CD launch window message in a game

Wessam Bahnassi

No no not at all. The use case I was referring to is someone running your full-screen app and then putting a CD that's not related to your app (a movie say). In that case yes, you don't disable autorun.
However, the use case you're describing is common and of course should be handled properly. This is how it should be done:

- Every disc of your title must have an autorun.ini that ultimately launches an executable.
- In every one of these executables, you check right at the beginning if your game is running (or its installer). If it is, then just exit silently. If not, proceed as normal.
- The check is best done through global named mutex objects. The game creates the mutex, and other exes check for it and try to create it. If it already exists, then just bail out.