One 0.7
The one and only
General
One searches after a window by class and/or title and executes a command depending on the state of the window.
Authors
Originally created by Erik Christiansson, aka Sci. Updates and modifications by ilmcuts and e-sushi.
Bangs
!One [class][title]([#flags])[not found command]([found command]([active command]))
!One [hwnd:window handle][not found command]([found command]([active command]))
The module searches for a window with the class and title provided. If the class or title is omitted, only the other one is used in the search. Note that both bracket pairs must be present at all times.
There is currently two flags available, a and w. If a is present, all windows will be searched (the default is to only search through top level windows). If w is present wildcards will be used to find the window, available wildcard characters are * (matches any character any number of times) and ? (matches any character once). The flags are optional.
If a window handle is specified instead of class and title, that window will be used.
If a window isn't found in the search the 'not found command' is executed. All other commands are optional.
The 'found command' is executed if the window is found. It defaults to the internal command .focus that brings the found window to the foreground.
The 'active command' is executed instead of the 'found command' if the found window currently has focus. If the 'active command' is omitted, the 'found command' is executed.
RC-commands
OneClosedCmd <command>
The default command to be executed if the window is not found. If no value is provided then the default value is ".none".
OneOpenCmd <command>
The default command to be executed if the window found. If no value is provided then the default value is ".focus".
OneActiveCmd <command>
The default command to be executed if the window currently has focus. If no value is provided then this defaults to OneOpenCmd.
Internal commands
The following commands can be used in the "found command" and "active command" parts of the !One bang.
.none
A dummy command. It has no effect.
.focus
Sets focus to the found window.
.minimize
Minimizes the found window.
.maximize
Maximizes the found window.
.restore
Restores the size of the found window to what it was before it was minimizes/maximized.
.close
Closes the found window.
.hide
Hides the found window.
.show
Shows the found window.
Changes
0.7 (27 apr 2004) Sci
Added support for wildcards in window searching.
All windows can now optionally be search, default is still to only search through only top level windows.
0.6 (30 dec 2003) Sci
Added ability to specify a window handle insted of a class and/or title.
Converted the documentation to HTML.
Now compiled with VS7, needs MSVCR70.dll.
0.5 (29 sep 2002) ilmcuts
You can now set a command to be executed if the window has focus.
Added the ability to change the default value of all three commands.
Added the dummy command .none.
0.4 (12 sep 2002) e-sushi
Added two more internal commands (.hide, .show)
0.3 (11 sep 2002) Sci
Added a few more internal commands (.close, .minimize, .maximize and .restore)
0.2 (12 jul 2002) Sci
You can now set a command to be executed if the window is found.
0.1 (10 jul 2002) Sci
First public release
Feedback
If you have a bug report, feature request, or any kind of feedback, feel free to email it to me at erik@alphafish.com. For more info and other LiteStep modules and programs, check out www.alphafish.com.
Sourcecode
The sourcecode for this module is distributed under the GNU Public License. If you didn't get the sourcecode with this module, you can download it from www.alphafish.com.