Athuga hvort annað eintak sé að keyra
Hvernig er hægt að athuga hvort annað eintak af forritinu sé að keyra(Í Windows)
// We only allow one instance of the app so we create a
// name that identifies it
strTmp.LoadString( IDR_MAINFRAME );
mutexName.Format( _T( "%s - %08x" ), strTmp, WINDOW_MAGIC_NUMBER );
// This mutex shows us if the app is already running
static CMutex appMutex( FALSE, (LPCTSTR)mutexName, NULL );
// Check if another instance has already acquired the mutex
if ( !appMutex.Lock( 0 ) )
{
// Other Instance running
}