program Project1; uses Forms, windows, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} var FMutexHandle: THandle; FMutexErrCode: integer; begin FMutexHandle := CreateMutex(nil, TRUE, pchar('여기다 중복되지 않을 뮤텍스 이름을 지정한다') ); FMutexErrCode := GetLastError; if FMutexHandle <> 0 then begin if FMutexErrCode = ERROR_ALREADY_EXISTS then begin CloseHandle(FMutexHandle); exit; end; end; Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end; |
'APP' 카테고리의 다른 글
Static 변수 사용하기 (0) | 2012.10.23 |
---|---|
TListView 스크롤바 없애기 (0) | 2012.10.23 |
바탕화면, 즐겨찾기, 내 문서 등의 경로얻기 (0) | 2012.10.23 |
GUID 생성 (0) | 2012.10.23 |
현재 떠있는 모든 창 캡션 구하기 (0) | 2012.10.23 |