Article ID: 106385 - Last Review: July 11, 2005 - Revision: 1.3 How To Identify a Previous Instance of an Application
This article was previously published under Q106385 SUMMARY
The entry point of both 16-bit (Win16) and 32-bit (Win32) Windows
applications is documented as follows:
To determine whether another instance of the application is running, use a named mutex. If opening the mutex fails, then there are no other instances of the application running. FindWindow() can be used with the class and window name. However, note that a second instance of the application could be started, and could execute the FindWindow() call before the first instance has created its window. Use a named object to ensure that this does not happen. MORE INFORMATION
The fact that hPrevInstance is set to NULL simplifies porting Win16
applications. Most 16-bit Windows-based applications contain the following
logic:
Under Win32, because hPrevInstance is always NULL, InitApplication() is always called, and each instance of an application will correctly register its window classes.
| Other Resources Other Support Sites
CommunityArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top