IApplicationWindows.ForegroundWindow

Fore Syntax

ForegroundWindow: IWin32Window;

Description

The ForegroundWindow property returns application window that is currently displayed in the foreground.

Fore Example

Executing the example requires a form named MyForm.

Sub Macro;
Var
    f: MyForm;
    win32window: IWin32Window;
Begin
    Win32window := WinApplication.Instance.Windows.ForegroundWindow;
    f := 
New MyForm.CreateForm(Win32window);
    f.ShowModal;
End Sub Macro;

This example is a macro for a regular report. At executing the macro the MyForm form is started modally for the regular report. After the form is closed the focus moves to the report.

See also:

IApplicationWindows