Launches the macro when the specified window appears, disappears, is activated, etc. To assign this trigger, use the Properties dialog. Easiest way - drag the "Drag" picture and drop on the window. While dragging, you can right-click to send window to bottom, or Ctrl + Shift + right-click to send child window to bottom.
You should specify at least window class. If class isn't unique, specify more properties. If class isn't specified, QM may ignore some windows (e.g., windows without caption).
Window name can be partial. Must match case. Empty string matches any window. Window class must be full.
You can also specify text inside window, that is, text of some child window that the window must contain. The text can be partial. Must match case. Class must be full. Accessible objects (e.g., objects in web pages) currently are not supported.
You can also specify window style - numeric value, or p (popup), or m (not popup).
If "Use *" is checked, strings (window name, class, child text and class) may contain wildcard characters * and ?. Strings without wildcard characters must match exactly. For example, to tell that window name must end with " - Notepad", check "Use *" and enter "* - Notepad". To tell that window name must be exactly "Notepad", check "Use *" and enter "Notepad". String "*" matches windows with no name.
In the window name field, you can use regular expression. First character must be $. For example, $Word.*\.(?i)rtf$ matches window name that contains "Word" and ends with ".rtf" or ".RTF" (first $ marks that you use regular expression, .* means any number of any characters, \. means literal ., (?i) sets "case insensitive" option, last $ means end of window name). Regular expression can be used to identify more than one window. Example: $(Notepad|Calc). When using regular expression, "Use *" is not applied to window name.
To launch macro when window is created (appears first time), you should select "Created & active". If window is shown but not activated, select "Created & visible". To launch macro each time when window is activated, select "Activated". You can use "Activated" with toolbars (this does not create more instances of the same toolbar on the same window). To launch macro each time when window name is changed and matches the specified name, select "Name changed".
If "Wait" is checked, the macro starts only when the window is ready to receive user input. However, this may not work with some windows, particularly with DOS and console windows.
Several items can have the same "Window" trigger. For example, a window can have several toolbars.
Window-triggered macro receives that window handle through _command variable. To get it, you can use val(_command) or TriggerWindow.
See also: Properties