Navigation: Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:Active ====== | |
A WINDOW, SYSTEM or IMAGE property. If the target is a WINDOW, PROP:Active returns 1 if the window is the active window, blank if not. Set to 1 to make the top window of a thread the active window.
If the SYSTEM variation is used, SYSTEM{Prop:Active} returns the number of active thread.
Setting PROP:Active to TRUE for an IMAGE control (runtime only) makes it active: it can be a parent/child of other controls and is painted separately without caching into the metafile of the owner window's background (i.e.,IMAGE controls with scroll bars).
Example:
CODE
OPEN(Window)
X# = START(AnotherThread) ! Start another thread
ACCEPT
CASE EVENT()
OF EVENT:LoseFocus ! When this window is losing focus
IF Y# <;> X# ! check for the first focus change
Window{PROP:Active} = 1 ! and return focus to this thread
Y# = X# ! then flag first focus change completed
END
END
END
AnyActiveThread PROCEDURE !lets any calling procedure know what thread
ActiveThread LONG,AUTO !is active.
CODE
ActiveThread = SYSTEM{PROP:Active}
RETURN CHOOSE(ActiveThread = THREAD(), 0, ActiveThread)