Archived

This topic is now archived and is closed to further replies.

spacemonkey005

mult. window instances

Recommended Posts

spacemonkey005    122
I searched around here thinking that I could find the answer, but with no luck. I am working on a game in C++/DirectX 8 and I want to limit the user to only have 1 instance of the game open at a time. The only examples I have been able to find are for MFC Apps.... Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites
SiCrane    11839
The most commonly used method is to use CreateMutex() to create and attempt to acquire a named mutex. If the attempt to acquire fails then there''s another instance of the application running.

An example of how to do this is available on MSDN.

Share this post


Link to post
Share on other sites
spacemonkey005    122
Thanks a bundle - exactly what I was hunting for. Minus one thing. Now after the .exe has been clicked again, how to make the current instance of it come to the front of the screen so users won''t get all confused! heh

Share this post


Link to post
Share on other sites