WinSetEnabled()

Auto Hotkey

WinSetEnabled

Disables or enables a window (respectively). When a window is disabled, the user cannot move it or interact with its controls. In addition, disabled windows are omitted from the alt-tab list.

WinSetEnabled OnOffToggle, WinTitle, WinText,  ExcludeTitle, ExcludeText
Command  Example: WinSetEnabled "On", "A"
Function Example: WinSetEnabled("On", "A")

Parameters

OnOffToggle

Use ON to turn on the setting, OFF to turn it off, or TOGGLE to set it to the opposite of its current state.

WinTitle

A window title or other criteria identifying the target window. See WinTitle.

WinText

If present, this parameter must be a substring from a single text element of the target window (as revealed by the included Window Spy utility). Hidden text elements are detected if DetectHiddenText is ON.

ExcludeTitle

Windows whose titles include this value will not be considered.

ExcludeText

Windows whose text include this value will not be considered.

Remarks

ErrorLevel is not changed by this command except where indicated above.

Window titles and text are case sensitive. Hidden windows are not detected unless DetectHiddenWindows has been turned on.

Related

WinHide, WinSetTitle, WinMove, WinActivate, Control

Examples

WinSetEnabled, toggle, Calculator ; Toggle the disabled status