RedEye exposes two families of window-control functions in RWML expressions:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ryzhpolsos/redeye/llms.txt
Use this file to discover all available pages before exploring further.
window.* functions manage shell windows you define in your own RWML configuration files, while wapi.* functions operate on any Win32 system window using its native window handle. Both families return an empty string and are primarily used as onClick or action values rather than for their return value.
Shell windows vs. system windows
window.* | wapi.* | |
|---|---|---|
| Target | Windows declared with <window id="..."> in RWML | Any Win32 window, identified by its HWND handle |
| Identifier | String id attribute from the RWML definition | Integer window handle, typically from a ${window.handle} variable |
| Scope | Only windows created and owned by RedEye | All visible windows in the desktop session |
Shell window functions (window.*)
Use these functions to show, hide, or toggle windows you have declared in your RWML configuration. You reference windows by the string id you assigned in the <window> element.
window.show(id)
window.show(id)
Makes a shell window visible. Has no effect if the window is already visible.Returns: An empty string.
The
id attribute of the target <window> element.window.hide(id)
window.hide(id)
Hides a shell window. Has no effect if the window is already hidden.Returns: An empty string.
The
id attribute of the target <window> element.window.close(id)
window.close(id)
Closes and destroys a shell window permanently.Returns: An empty string.
The
id attribute of the target <window> element.window.toggle(id)
window.toggle(id)
Toggles a shell window between visible and hidden states.Returns: An empty string.
The
id attribute of the target <window> element.Real-world example: start menu
The default RedEye start menu useswindow.toggle to open on Win and window.hide to close when focus is lost:
System window functions (wapi.*)
Use these functions to control any Win32 window by its handle. In RWML, the handle is most often available as ${window.handle} inside a <windowList> template, where it refers to the handle of the currently-rendered window entry.
wapi.minimizeWindow(handle)
wapi.minimizeWindow(handle)
Minimizes the specified system window.Returns: An empty string.
The integer
HWND handle of the window to minimize.wapi.restoreWindow(handle)
wapi.restoreWindow(handle)
Restores (un-minimizes) the specified system window to its previous size and position.Returns: An empty string.
The integer
HWND handle of the window to restore.wapi.activateWindow(handle)
wapi.activateWindow(handle)
Brings the specified system window to the foreground and gives it keyboard focus.Returns: An empty string.
The integer
HWND handle of the window to activate.wapi.toggleWindow(handle)
wapi.toggleWindow(handle)
Toggles a system window between its normal state and minimized. If the window is minimized, it is restored and activated; otherwise it is minimized.Returns: An empty string.
The integer
HWND handle of the window to toggle.wapi.closeWindow(handle)
wapi.closeWindow(handle)
Sends a close message to the specified system window (equivalent to clicking the window’s X button).Returns: An empty string.
The integer
HWND handle of the window to close.wapi.minimizeAllWindows()
wapi.minimizeAllWindows()
Minimizes every system window that is currently tracked by the shell event listener. Equivalent to “Show Desktop”.Returns: An empty string.
wapi.restoreAllWindows()
wapi.restoreAllWindows()
Restores every system window that was previously minimized by the shell event listener.Returns: An empty string.
wapi.toggleAllWindows()
wapi.toggleAllWindows()
Toggles the minimize state of all tracked system windows. The first call minimizes all windows; the second call restores them. State is tracked internally per shell session.Returns: An empty string.
Real-world example: taskbar window list
The default taskbar useswapi.toggleWindow on click and wapi.closeWindow in the context menu:
PowerSearch launcher
PowerSearch is the built-in application launcher. These functions open or configure it from expressions.powerSearch.open()
powerSearch.open()
Opens the PowerSearch launcher overlay.Returns: An empty string.
Real-world example: key bindings
Related pages
Expression functions
General-purpose expression functions.
Shell windows
Define and configure shell window elements.
Hotkeys
Bind window functions to keyboard shortcuts.