Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
function RunExecutable (const FileName : String; WaitForIt : boolean) :DWORD;
var
StartupInfo: TStartupInfo;
ProcessInfo: TProcessInformation;
errMsg: pChar;
begin
Result := STILL_ACTIVE;
GetStartupInfo(StartupInfo);
if CreateProcess(nil, PChar(FileName), nil, nil, IsConsole,
NORMAL_PRIORITY_CLASS, nil, nil, StartupInfo, ProcessInfo)then
begin
try
if (not WaitForIt)
or (WaitForSingleObject(ProcessInfo.hProcess,INFINITE) = WAIT_OBJECT_0) then
GetExitCodeProcess(ProcessInfo.hProcess, Result);
finally
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
end;
end
else
begin
if FormatMessage (Format_Message_Allocate_Buffer
or Format_Message_From_System, nil, GetLastError, 0, @errMsg, 0, nil) <> 0 then
begin
try
raise Exception.Create ('CreateProcess failed with error "' + String (errMsg) + '".');
finally
LocalFree (Cardinal (errMsg));
end;
end;
end;
end;