IApplicationWindows.ForegroundWindow

Syntax

ForegroundWindow: IWin32Window;

Description

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

Example

Executing the example requires a form named MyForm.

Sub Macro;
Var
    win32window: IWin32Window;
    f: MyForm;
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. After executing the macro the MyForm form is started modally relative to the regular report. After the form closes, the report gets focused.

See also:

IApplicationWindows