Instance: IWinApplication;
Instance[Context = ForeRuntimeContext]: IPrognoz.Platform.Interop.Ui.WinApplication;
The Instance property returns the object that is used to work with the started application.
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.
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.
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: