判断应用程序进否正在运行:
function fAppIsRun : boolean;
var
hMutex: THandle;
begin
result := false;
hMutex:=CreateMutex(nil,false,'PCBERP');
if (hMutex > 0) and (GetLastError = ERROR_ALREADY_EXISTS) then
result := true;
end;