BOOL EnsureSingleInstance( LPCTSTR lpszName )
{
	HANDLE hMutex = ::CreateMutex( NULL, FALSE, lpszName );

	if ( ERROR_ALREADY_EXISTS == ::GetLastError() )
	{
		::ReleaseMutex( hMutex );
		return FALSE;
	}

	return TRUE;
}



EnsureSingleInstance 에 원하는 이름만 넣어주면 됩니다.
Kernel Object Namespaces 에 따라서 움직입니다.

자세한 Naming 방법은 Link를 참고해주세요~

아.. Code Hilighting 완전 노가다.......... -_-;

+ Recent posts