IWinApplicationClass.Instance

Fore Syntax

Instance: IWinApplication;

Fore.NET Syntax

Instance[Context = ForeRuntimeContext]: IPrognoz.Platform.Interop.Ui.WinApplication;

Description

The Instance property returns the object that is used to work with the started application.

Comments

On working in Fore.NET the Null value is passed as a value of the Context parameter. The alternative to the Instance property is initialization of the WinApplicationClass_2 class object that implements the object in Fore.NET, which is identical to the WinApplication class object in Fore.

Fore Example

Sub UserProc;
Var
    WinApp: IWinApplication;
Begin
    WinApp := WinApplication.Instance;
    //Further working with properties and methods IWinApplication via the WinApp variable
End Sub UserProc;

The example shows in general the way of getting the object that is used to control started application.

Fore.NET Example

Imports Prognoz.Platform.Interop.Ui;

Sub UserProc();
Var
    WinAppCls: WinApplicationClass = New WinApplicationClassClass();
    WinApp: WinApplication;
Begin
    //Use of the Instance property
    WinApp := WinAppCls.Instance[Null];
    //Alternative option
    WinApp := New WinApplicationClass_2();
    //Further working with properties and methods IWinApplication via the WinApp variable
End Sub;

The example shows in general two ways of getting the object that is used to control started application: by using the Instance property and via initialization of the WinApplicationClass_2 class object.

See also:

IWinApplicationClass