|
Hi
If you
are starting acrobat from your application then you could try starting it using
the code below that will not return until the program you started has
finished. I am not sure of the origion of the code but it works for me where I
call pkunzip and don't want to carry on until it is
complete.
Warren.S
function WinExecAndWait(CmdLine,DefaultDir: string; showCmd: Word; Yield:
Boolean): Integer;
// Spawn Exe and wait until finished //if Yield then ProcessMessages var StartUpInfo: TStartupInfo; ProcessInfo: TProcessInformation; ProcessStatus: DWORD; lpExitCode: DWORD; // address to receive termination status begin Result := -1; Fillchar(StartUpInfo, SizeOf(StartUpInfo), #0); with StartUpInfo do begin cb := SizeOf(StartUpInfo); wShowWindow := showCmd; end; UniqueString(CmdLine); if not (CreateProcess(nil, PChar(CmdLine), nil, nil, False, //Spawn CREATE_DEFAULT_ERROR_MODE, nil, PChar(DefaultDir), StartUpInfo, ProcessInfo)) then Exit; with ProcessInfo do begin //wait until process finished WaitForInputIdle(hProcess, INFINITE); CloseHandle(hThread); while GetExitCodeProcess(hProcess, ProcessStatus) and (ProcessStatus = STILL_ACTIVE) do if Yield then Application.ProcessMessages; GetExitCodeProcess(hProcess, lpExitCode); result := lpExitCode; CloseHandle(hProcess); end; end;
This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal - For more information please visit www.marshalsoftware.com |
- [DUG]: How do I examine the printer queue? Dave . Jollie
- RE: [DUG]: How do I examine the printer queue? Warren Slater (ASL)
- RE: [DUG]: How do I examine the printer queue? Dave . Jollie
