home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d09xx
/
d0964.lha
/
Angie
/
SetActiveWinUtil
/
SetActiveWin.doc
next >
Wrap
Text File
|
1993-11-30
|
8KB
|
198 lines
------------------------------------------------------
SetActiveWin 1.2 (30.11.93) ⌐ Franz Schwarz - Freeware
------------------------------------------------------
Activates exactly the window you want
Written & ⌐ 1993 by
Franz Schwarz
Mⁿhlenstra▀e 2
D-78591 Durchhausen, Germany
Uucp: Franz_Schwarz@mil.ka.sub.org
Fido Classic: 2:2476/506.18
SetActiveWin is a small shell utility to activate exactly the window YOU
want. As there are many matching characteristics you can set, it is very
likely that you can really make it activate (almost) ANY window!
The command line argument stencil of SetActiveWin is
WINDOWNAME=WPAT,TASKNAME=TPAT,SCREENNAME=SPAT,PUBSCREENNAME=PSPAT,
CASE/S,TOFRONT/S:
All of the arguments of the first argument line specify a filter pattern
for a specific filter characteristic:
WINDOWNAME=WPAT represents the filter pattern for the window's name. If
this argument is neglected, any window matches.
TASKNAME=TPAT represents a filter pattern for the name of the window's
owner task, If the specified filter doesn't match the task's name, the
shell command name of the window's owner task (if present) is accounted for
another comparison. If this argument is neglected, any window matches.
SCREENNAME=SPAT represents a filter pattern for the DEFAULT name of the
screen on which the window is opened. If this argument is neglected, any
window matches.
PUBSCREENNAME=PSPAT represents a filter pattern for the default public
screen name of the screen on which the window is opened. If this argument
is neglected, any window matches, otherwise only windows that are opened on
a public screen with the specified name match.
For all filter arguments, AmigaDos name patterns are expected (e.g
"CygnusEdScreen?", "#?workbench( |%)#?". However, there exists a special
'magic' name for all filter arguments: "!":
-for the WINDOWNAME=WPAT filter, only the active window matches.
-for the TASKNAME=TPAT filter, only a window with the same owner task
as the active window matches.
-for the SCREENNAME=SPAT filter, only a window that is opened on the
active screen matches.
-for the PUBSCREENNAME=PSPAT filter, only a window that is opened on the
default public screen matches.
IF the CASE/S argument switch is specified, the case of characters is
considered for all comparisions, as opposed to case-insensitive
comparisions if this switch is omitted.
A window only matches if ALL of the four filter characteristics match. The
search for a matching window starts at the NEXT window after the ACTIVE
window, enabling easy SHUFFLING of all matching windows.
The TOFRONT/S argument switch causes that the resuling window is popped to
the front, apart from being activated.
If SetActiveWin finds a matching window, it returns 0 (OK), otherwise, if
it can't find a window that comes up to all the four matching
characteristics, it returns 5 (WARN).
SetActiveWin is especially designed for the use within AngieSequences of
the great ANGIE - Another Great Intuition Enhancer commodity, but it may be
used in batch command files, ARexx scripts and elsewhere, too.
For use in Angie, you should make SetActiveWin resident (Yes, SetActiveWin
IS reentrant, pure) and then use it within SyncDosSequences:
If you map the AngieSequence
'{SetActiveWin tpat "IntuiNews#?" tofront}(HuntWindow)' to the function key
f10, for example, then you can shuffle with your f10 function key through
all your IntuiNews windows.
If you want to shuffle through all the windows of your currently active
application, simply map '{SetActiveWin tpat ! tofront}(HuntWindow)' to the
f10 function key, or something like that.
or you may map
'{setactivewin "(Workbench|%)" tpat Workbench pspat Workbench case}'
(HuntWindow)' to 'rawmouse alt rbutton mouse_rightpress' which would
make your Workbench root window being activated and hunted whenever you
click on your right mouse button in conjunction with the left alt key.
or you may map
'{setactivewin "SuperDuper#?by#?S#?Vigna#?" tofront}(HuntWindow)' to
'diskinserted' which would cause the main window of SuperDuper to be
activated and hunted whenever a disk is inserted.
You see, the possibilities are nearly unlimited!
... you can do even MORE:
Map the following AngieSequence to a hotkey (substitute the <control-j>
terms by a key press on the 'j' key with an activated CTRL qualifier key):
'[SetActiveWin wpat IconEdit#? tpat #?IconEdit tofront<control-j>
if warn<control-j>
run <nil: >nil: sys:tools/IconEdit<control-j>
wait 2<control-j>
endif<control-j>
rawinsert d "<lcommand help>"]'
If you now trigger the hotkey, Angie simply activates & pops the window of
the IconEdit tool, if it is launched, otherwise it launches the IconEdit
tool. Then, my rawinsert utility inserts a <lcommand help> keypress into
the input stream which triggers a HuntWindow action if you have mapped a
'(HuntWindow)' AngieSequence to the <lcommand help> rawkey.
Note that in this AngieSequence, SetActiveWin is used in conjunction with an
ASyncDosSequence due to the long execution time of this AngieSequence, as
otherwise Angie would be blocked during the whole execution.
program history
---------------
v1.0 21.11.93 [fSchwarz]
v1.1 22.11.93 [fSchwarz] fixed deadlock problem that was
due to holding concurrent locks on both, IBase & the
PubScreenList (PubScreenList fields are now copied)
v1.2 30.11.93 [fSchwarz] fixed bug that kept all windows
on non-public screens from being activated
final notes
-----------
SetActiveWin is Freeware, i.e. freely distributable, yet copyrighted
software.
Suggestions, comments, bug reports, criticism, praise, gifts, etc. are
welcomed!
If you want to translate this documentation into other languages, feel
free to do so, add the translation to this archive, and send it to the
author (that is me;-))
SetActiveWin is copyrighted and protected by copyright laws all over
the world. Copyright ⌐ 1993 Franz Schwarz.
The author can't be hold liable for any harm that stems from the
usage of this program, no matter whether direct harm or indirect harm.
SetActiveWin is freely distributable; it may be published in the Fred Fish
& Amok software collections and in other non-commercial software
collections, including CD-ROM versions of them. Moreover, it may be spread
via electronic data transfer.
SetActiveWin may only be distributed in this archive as a whole. It may
be only distributed if the distributor does not claim any copyright on the
SetActiveWin archive nor on any files that are compulsorily distributed
with it (i.e. the distributor claims that this archive may not be
distributed separately without those files). Inquiries on exceptions from
these limitations may be submitted to the author.
contacting the author
---------------------
Franz Schwarz
Mⁿhlenstra▀e 2
D-78591 Durchhausen, Germany
Uucp: Franz_Schwarz@mil.ka.sub.org
Fido Classic: 2:2476/506.18
Bank account 951.207 at
KSK Trossingen, Germany, bank ZIP code 643 500 70
Have fun, and don't you forget:
SetActiveWin - Activates exactly the window you want
Franz 'Blacky' Schwarz
- Girlfriend Is Better - Talking Heads -