home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0964.lha / Angie / SetActiveWinUtil / SetActiveWin.doc next >
Text File  |  1993-11-30  |  8KB  |  198 lines

  1.  
  2.           ------------------------------------------------------
  3.           SetActiveWin 1.2 (30.11.93) ⌐ Franz Schwarz - Freeware
  4.           ------------------------------------------------------
  5.  
  6.                    Activates exactly the window you want
  7.  
  8.                             Written & ⌐ 1993 by
  9.                                Franz Schwarz
  10.                               Mⁿhlenstra▀e 2
  11.                        D-78591 Durchhausen, Germany
  12.                     Uucp: Franz_Schwarz@mil.ka.sub.org
  13.                         Fido Classic: 2:2476/506.18
  14.  
  15.  
  16.  
  17. SetActiveWin is a small shell utility to activate exactly the window YOU
  18. want. As there are many matching characteristics you can set, it is very
  19. likely that you can really make it activate (almost) ANY window!
  20.  
  21. The command line argument stencil of SetActiveWin is
  22.  
  23.     WINDOWNAME=WPAT,TASKNAME=TPAT,SCREENNAME=SPAT,PUBSCREENNAME=PSPAT,
  24.                              CASE/S,TOFRONT/S:
  25.  
  26. All of the arguments of the first argument line specify a filter pattern
  27. for a specific filter characteristic:
  28.  
  29. WINDOWNAME=WPAT represents the filter pattern for the window's name.  If
  30. this argument is neglected, any window matches.
  31.  
  32. TASKNAME=TPAT represents a filter pattern for the name of the window's
  33. owner task, If the specified filter doesn't match the task's name, the
  34. shell command name of the window's owner task (if present) is accounted for
  35. another comparison.  If this argument is neglected, any window matches.
  36.  
  37. SCREENNAME=SPAT represents a filter pattern for the DEFAULT name of the
  38. screen on which the window is opened.  If this argument is neglected, any
  39. window matches.
  40.  
  41. PUBSCREENNAME=PSPAT represents a filter pattern for the default public
  42. screen name of the screen on which the window is opened.  If this argument
  43. is neglected, any window matches, otherwise only windows that are opened on
  44. a public screen with the specified name match.
  45.  
  46. For all filter arguments, AmigaDos name patterns are expected (e.g
  47. "CygnusEdScreen?", "#?workbench( |%)#?".  However, there exists a special
  48. 'magic' name for all filter arguments:  "!":
  49.   -for the WINDOWNAME=WPAT filter, only the active window matches.
  50.   -for the TASKNAME=TPAT filter, only a window with the same owner task
  51.    as the active window matches.
  52.   -for the SCREENNAME=SPAT filter, only a window that is opened on the
  53.    active screen matches.
  54.   -for the PUBSCREENNAME=PSPAT filter, only a window that is opened on the
  55.    default public screen matches.
  56.    
  57.  
  58. IF the CASE/S argument switch is specified, the case of characters is
  59. considered for all comparisions, as opposed to case-insensitive
  60. comparisions if this switch is omitted.
  61.  
  62.  
  63. A window only matches if ALL of the four filter characteristics match.  The
  64. search for a matching window starts at the NEXT window after the ACTIVE
  65. window, enabling easy SHUFFLING of all matching windows.
  66.  
  67.  
  68. The TOFRONT/S argument switch causes that the resuling window is popped to
  69. the front, apart from being activated.
  70.  
  71.  
  72. If SetActiveWin finds a matching window, it returns 0 (OK), otherwise, if
  73. it can't find a window that comes up to all the four matching
  74. characteristics, it returns 5 (WARN).
  75.  
  76.  
  77. SetActiveWin is especially designed for the use within AngieSequences of
  78. the great ANGIE - Another Great Intuition Enhancer commodity, but it may be
  79. used in batch command files, ARexx scripts and elsewhere, too.
  80.  
  81. For use in Angie, you should make SetActiveWin resident (Yes, SetActiveWin
  82. IS reentrant, pure) and then use it within SyncDosSequences:
  83.  
  84. If you map the AngieSequence
  85. '{SetActiveWin tpat "IntuiNews#?" tofront}(HuntWindow)' to the function key 
  86. f10, for example, then you can shuffle with your f10 function key through
  87. all your IntuiNews windows.
  88.  
  89. If you want to shuffle through all the windows of your currently active
  90. application, simply map '{SetActiveWin tpat ! tofront}(HuntWindow)' to the 
  91. f10 function key, or something like that.
  92.  
  93. or you may map
  94. '{setactivewin "(Workbench|%)" tpat Workbench pspat Workbench case}'
  95.  (HuntWindow)' to 'rawmouse alt rbutton mouse_rightpress' which would
  96. make your Workbench root window being activated and hunted whenever you
  97. click on your right mouse button in conjunction with the left alt key.
  98.  
  99.  
  100. or you may map
  101. '{setactivewin "SuperDuper#?by#?S#?Vigna#?" tofront}(HuntWindow)' to
  102. 'diskinserted' which would cause the main window of SuperDuper to be
  103. activated and hunted whenever a disk is inserted.
  104.  
  105. You see, the possibilities are nearly unlimited!
  106.  
  107. ... you can do even MORE:
  108.  
  109. Map the following AngieSequence to a hotkey (substitute the <control-j>
  110. terms by a key press on the 'j' key with an activated CTRL qualifier key):
  111.  
  112. '[SetActiveWin wpat IconEdit#? tpat #?IconEdit tofront<control-j>
  113.   if warn<control-j>
  114.   run <nil: >nil: sys:tools/IconEdit<control-j>
  115.   wait 2<control-j>
  116.   endif<control-j>
  117.   rawinsert d "<lcommand help>"]'
  118.  
  119. If you now trigger the hotkey, Angie simply activates & pops the window of
  120. the IconEdit tool, if it is launched, otherwise it launches the IconEdit
  121. tool.  Then, my rawinsert utility inserts a <lcommand help> keypress into
  122. the input stream which triggers a HuntWindow action if you have mapped a
  123. '(HuntWindow)' AngieSequence to the <lcommand help> rawkey.
  124. Note that in this AngieSequence, SetActiveWin is used in conjunction with an 
  125. ASyncDosSequence due to the long execution time of this AngieSequence, as
  126. otherwise Angie would be blocked during the whole execution.
  127.  
  128.  
  129.                               program history
  130.                               ---------------
  131.  
  132.   v1.0 21.11.93 [fSchwarz]
  133.  
  134.   v1.1 22.11.93 [fSchwarz] fixed deadlock problem that was
  135.     due to holding concurrent locks on both, IBase & the
  136.     PubScreenList (PubScreenList fields are now copied)
  137.  
  138.   v1.2 30.11.93 [fSchwarz] fixed bug that kept all windows
  139.     on non-public screens from being activated
  140.  
  141.  
  142.                                 final notes
  143.                                 -----------
  144.  
  145. SetActiveWin is Freeware, i.e.  freely distributable, yet copyrighted
  146. software.
  147.  
  148. Suggestions, comments, bug reports, criticism, praise, gifts, etc. are
  149. welcomed!
  150.  
  151. If you want to translate this documentation into other languages, feel 
  152. free to do so, add the translation to this archive, and send it to the
  153. author (that is me;-))
  154.  
  155. SetActiveWin is copyrighted and protected by copyright laws all over
  156. the world. Copyright ⌐ 1993 Franz Schwarz.
  157.  
  158. The author can't be hold liable for any harm that stems from the
  159. usage of this program, no matter whether direct harm or indirect harm.
  160.  
  161. SetActiveWin is freely distributable; it may be published in the Fred Fish
  162. & Amok software collections and in other non-commercial software
  163. collections, including CD-ROM versions of them.  Moreover, it may be spread
  164. via electronic data transfer.
  165.  
  166. SetActiveWin may only be distributed in this archive as a whole.  It may
  167. be only distributed if the distributor does not claim any copyright on the
  168. SetActiveWin archive nor on any files that are compulsorily distributed
  169. with it (i.e.  the distributor claims that this archive may not be
  170. distributed separately without those files).  Inquiries on exceptions from
  171. these limitations may be submitted to the author.
  172.  
  173.  
  174.                            contacting the author
  175.                            ---------------------
  176.  
  177.                                Franz Schwarz
  178.                               Mⁿhlenstra▀e 2
  179.                        D-78591 Durchhausen, Germany
  180.                     Uucp: Franz_Schwarz@mil.ka.sub.org
  181.                         Fido Classic: 2:2476/506.18
  182.                          Bank account 951.207 at 
  183.              KSK Trossingen, Germany, bank ZIP code 643 500 70
  184.  
  185.  
  186.  
  187.  
  188. Have fun, and don't you forget:
  189.           SetActiveWin - Activates exactly the window you want
  190.  
  191.  
  192.  
  193.   Franz 'Blacky' Schwarz
  194.  
  195.                - Girlfriend Is Better - Talking Heads -
  196.  
  197.  
  198.