Function isapprunningindelphi: boolean;
VAR
Hkerneldll: thandle;
Proc_IndebuggerPresent: tprocismebuggerpresent;
UsefindWindow: Boolean;
PROC: FARPROC;
Begin
UsefindWindow: = true;
IF (Win32Platform = Ver_Platform_Win32_NT) THEN
Begin
// Winnt
Try
Hkerneldll: = getModuleHandle (kernel32);
IF (hkerneldll = -1) THEN
Hkerneldll: = loadingLibrary (kernel32);
IF (Hkerneldll <> -1) THEN
Begin
Proc: = GetProcaddress (Hkerneldll, 'IsDebuggerPresent');
IF (Proc <> NIL) THEN
Begin
Proc_IndebuggerPresent: = proc;
Result: = proc_isdebuggerpresent;
UsefindWindow: = false;
END;
END;
Except
END;
END;
IF (usefindWindow)
Begin
IF FindWindow ('TappBuilder', NIL) <> 0 THEN
Result: = TRUE
Else
Result: = FALSE;
END;
END;