Blitz3D+ Command Reference

ActiveWindow ( )

Parameters

None.

Description

Returns the handle of the currently active GUI window, or 0 if none is active.

Tells you which of your program's windows currently has activation - the one with the highlighted title bar that keyboard input goes to. If the user has switched to a different application (or your program has no GUI windows), it returns 0.

In a multi-window tool this is how context-sensitive commands find their target: a Save hotkey can save the document belonging to whichever window the user is working in. Requesters such as Confirm and RequestFile also attach themselves to the active window automatically.

If you would rather react to activation changes than poll for them, watch for window-activate events ($804) on the shared event queue and read EventSource.

The world editor shell sample shows the event loop this fits into.

Requires Extended mode.

See also: ActivateWindow, CreateWindow, EventSource, WindowMinimized, Confirm.

Index