2008/11/09

프로그램 중복 실행 방지하기


HANDLE Mutex;

const char ProgMutex[] = "MyApp";

if (( Mutex = OpenMutex(MUTEX_ALL_ACCESS, false, ProgMutex)) == NULL )
Mutex = CreateMutex( NULL, true, ProgMutex );
else
{
MessageDlg( "Already Running", mtError, TMsgDlgButtons() << mbOK, 0 );
return 0;
}

Original Post : http://neodreamer-dev.tistory.com/194

No comments :

Post a Comment