One 0.6
The one and only


General
One searches after a window by class and/or title and executes a command if it's not found. If it on the other hand is found, One brings the window to the top of the z-order.


Authors
Originally created by Erik Christiansson, aka Sci. Updates and modifications by ilmcuts and e-sushi.


Bangs
!One [class][title][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.
If a window handle is specified insted of class and/or 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.6 (## 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.