var
hMutex:HWND;
Ret:Integer;
begin
Application.Initialize;
Application.Title := 'aaaaaa';
hMutex:=CreateMutex(nil,False,'aaaaaa');
Ret:=GetLastError;
If Ret<>ERROR_ALREADY_EXISTS Then
Begin
Application.CreateForm(TForm1, Form1);
Application.Run;
End
Else
Application.MessageBox('Run Twice!','Notes!',MB_OK);
ReleaseMutex(hMutex);
end.