IWinShellExecuteInfo.WaitToTerminate

Syntax

WaitToTerminate: Boolean;

Description

The WaitToTerminate property determines whether to wait for completion of the started application.

Comments

If the property is set to True, the currently running application is waiting for completion of the application started afterwards. The current application is not available while waiting. The waiting period lasts for the time determined in the WaitTimeout property.

Fore Example

Sub UserProc;
Var
    Info: IWinShellExecuteInfo;
Begin
    Info := New WinShellExecuteInfo.Create;
    Info.File := "calc.exe";
    Info.WaitToTerminate := True;
    Info.WaitTimeout := 10000;
    WinApplication.ShellExecute(Info);
End Sub UserProc;

Calculator is started on executing the example. The currently running application is unavailable awaiting for ten seconds of its completion. After the specified time the current application is available for work again.

Fore.NET Example

Imports Prognoz.Platform.Interop.Ui;

Sub UserProc();
Var
    Info: WinShellExecuteInfo;
    WinAppCls: WinApplicationClassClass = New WinApplicationClassClass();
Begin
    Info := New WinShellExecuteInfoClass();
    Info.File := "calc.exe";
    Info.WaitToTerminate := True;
    Info.WaitTimeout := 10000;
    WinAppCls.ShellExecute(Info);
End Sub;

Calculator is started on executing the example. The currently running application is unavailable awaiting for ten seconds of its completion. After the specified time the current application is available for work again.

See also:

IWinShellExecuteInfo