Hi,
I'm using mutex to insure that only one instance of one of my application is running with this code (in Project.dpr):
I've also associated the application to some file extensions. But if they have the application running, and the user double clicks on an associated file in Windows Explorer all they get is 'Only one allowed!'. How can I get the current instance to load the file instead of displaying 'Only one allowed!'.
I'm using mutex to insure that only one instance of one of my application is running with this code (in Project.dpr):
Code:
var
hMutex: THandle;
begin
hMutex := CreateMutex(nil, False, 'termBlaster');
if WaitForSingleObject (HMutex, 0) = WAIT_TIMEOUT then
begin
MessageDlg ('Only one allowed!', mtInformation, [mbOK], 0);
Application.Terminate;
exit;
end;
I've also associated the application to some file extensions. But if they have the application running, and the user double clicks on an associated file in Windows Explorer all they get is 'Only one allowed!'. How can I get the current instance to load the file instead of displaying 'Only one allowed!'.