Description
This function detect if another copy of application is running
Delphi code
Function IsRunningApp:Boolean;
var
Hwnd:Thandle;
begin
hwnd:=CreateMutex(nil,False,'OneCopyMutex');
Result:=false;
If not(WaitForSingleObject(Hwnd,0)<>Wait_TimeOut) then
Result:=true;
end;