RosettaCodeData/Task/Determine-if-only-one-instance-is-running/C++/determine-if-only-one-instance-is-running-3.cpp

6 lines
153 B
C++
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
mutex = CreateMutex( NULL, TRUE, "MyApp" );
if ( GetLastError() == ERROR_ALREADY_EXISTS )
{
// There's another instance running. What do you do?
}