IWinApplicationClass.ShellExecute

Syntax

ShellExecute(Info: IWinShellExecuteInfo);

Parameters

Info. Information about file (application) to be started.

Description

The ShellExecute method opens the file or application, information on which is passed in the Info parameter.

Comments

If the error message appears on opening the file or application, the exception is thrown for the ShellExecute method.

Fore Example

Executing the example requires the file C:\Doc\Catalog.xls.

Sub UserProc;
Var
    Info: IWinShellExecuteInfo;
Begin
    Info := New WinShellExecuteInfo.Create;
    Info.Directory := "C:\Doc";
    Info.File := "Catalog.xls";
    WinApplication.ShellExecute(Info);
End Sub UserProc;

On executing the example the specified file is opened with the application assigned for this in operating system.

Fore.NET Example

Executing the example requires the file C:\Doc\Catalog.xls.

Imports Prognoz.Platform.Interop.Ui;

Sub UserProc();
Var
    Info: WinShellExecuteInfo = New WinShellExecuteInfoClass();
    WinAppCls: WinApplicationClass = New WinApplicationClassClass();
Begin
    Info.Directory := "C:\Doc";
    Info.File := "Catalog.xls";
    WinAppCls.ShellExecute(Info);
End Sub;

On executing the example the specified file is opened with the application assigned for this in operating system.

See also:

IWinApplicationClass