home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
hotkey01.zip
/
README.1ST
< prev
next >
Wrap
Text File
|
1998-01-27
|
18KB
|
348 lines
The following text is copyright Gary Britt, CompuServe ID 72073,2445.
The following explanation details how to setup OS/2 so that you can configure
hotkeys for your programs that allow you to jump directly from where you are
to a specific program. There are several commercial, shareware, and freeware
programs available that allow you to do this, but none of these programs allow
you to hotkey "FROM" a full screen windows session. All but one of them don't
allow you to hotkey "FROM" a full screen DOS session of any kind.
By following the instructions that follow you can setup OS/2 to allow hotkey
jumping from seamless/windowed programs AND from full screen windows and full
screen DOS sessions.
What is necessary is to put together a few publicly available shareware and
freeware OS/2 programs, and then configure things properly.
First you need to get one of the freeware or commercial hotkey programs for
OS/2. There are two good freeware hotkey programs available for OS/2. One
is HookXX.zip by Morton Kaplan (I believe Hook55.zip is the current edition)
and another is Jumpkey/2, which is IBM employee written software by Thomas E.
Link. Mr. Link is still an employee at IBM. While both of these are
excellent, I prefer Jumpkey/2 because it has an easier to configure interface.
However, Hook has some features that Jumpkey/2 doesn't. I have included
Jumpkey/2 as part of this upload. Normally Jumpkey/2 allows hotkeys based
upon Control+<key>, Alt+<key>, and Control-Shift+<key>. I prefer using
Control-Alt+<key> hotkey combinations, and if you are like me then you can
substitute the Hotdll32.C-A file for the Hotdll32.dll file. Just rename
Hotdll32.dll to something like Hotdll32.ORI and copy Hotdll32.C-A to
Hotdll32.dll. Thereafter when you select a hotkey based upon Control+Shift
+<key> in the configuration dialog of Jumpkey/2 it will really work as
Control+Alt+<key>. There is a text file that details how the DLL file was
modified if you are interested or want to implement Alt+Shift+<key> hotkeys.
Using Jumpkey/2 (or Hook) takes care of having hotkeys for jumping between
seamless and windowed DOS, OS/2, and windows programs. The instructions below
will show you how to configure hotkeys to jump FROM full screen windows and
DOS sessions.
Here is how to setup hotkeys to jump from full screen windows and DOS
sessions:
1. Download the freeware FM_Utilities available on CompuServe,
and off the web, by Mark Kimes (author of the FM/2 OS/2 file manager).
Among these very handy utilities are two programs called "Switchto" and
"Switchtp". Switchto lets you switch from a full screen DOS/windows session
to another full screen DOS/windows session. Switchtp lets you switch from a
full screen DOS/windows session to a Presentation Manager OS/2, DOS, or
seamless windows session.
2. Switchto takes as a parameter the name of the session to be switched
to. Get this name from the right hand side of the OS/2 task list. For
example I run a full screen DOS program called Xtree Pro Gold. It appears
in the task list as "Xtree Pro Gold - XTG.EXE". To use Switchto to switch
to this program the command line is - Switchto xtg - .
Switchtp takes as a parameter the name of the PM session to be switched to
as shown on the right hand side of the OS/2 task list. For example,
if I am in a full screen DOS/windows session and I want to switch to
"Microsoft Word - Microsoft Word - Document 1" running seamless on my
desktop the command to do this is - Switchtp "Microsoft Word".
3. To get a feel for how this works you can manually enter these commands
at a full screen DOS prompt or by using the "File - Run" dialog of program
manager in a full screen windows session. Play with these commands manually
from the command line a few times until you understand how they work.
4. Once you see how these commands can be used on your system, the final
step is to find a way to configure your full screen sessions so that these
commands can be processed automatically via the striking of a hotkey.
This turns out to be much easier than one would suspect. It is actually
easiest to setup in a full screen windows session versus a full screen DOS
session!!
5. Windows provides several ways to launch a program via the selection of
a hotkey. One way that anyone can do with just the programs already on
their hard disk is as follows:
A. Setup a separate icon in program manager (use File - New) for
each full screen or PM session that you might want to switch to from your
full screen windows session. The command line for these program manager
icons on my system would be something like - c:\<path>\switchto xtg -
or - c:\<path>\switchtp "Microsoft Word" -.
B. You will notice that when creating a new icon for a program to
be launched in windows' program manager that you can assign a hotkey to
this program. Be sure to select a hotkey when completing the dialog for
these new icons.
C. Bingo that's all there is to it. From then on anytime you are
in a full screen windows session if you make program manager active and
hit the hotkey you will be automatically switched to the full screen
DOS/windows session or PM session selected for that icon!!!!!!
D. You can create a hotkey that will make program manager active by
creating an icon for program manager itself (i.e. progman.exe) and
assigning a hotkey to this icon. Then put this icon in your windows
startup group. A second copy of program manager will not be run, but the
hotkey for program manager will be activated so that you can strike the
hotkey for program manager from any windows program and then immediately
strike the hotkey for the session you want to switch to and VIOLA. You
switch from a full screen windows session to any other session via a
hotkey.
6. Now the above is just one of many ways that could be setup to hotkey
from a full screen windows session. You can use almost any windows 3.1
utility program that allows for the launching of a program via hotkey to
do the above. You could use almost any windows 3.1 program that provides
a popup menu to select a program from to run to setup a hotkey for
launching these switchto/switchtp programs.
For example, I have always used an absolutely fantastic keyboard/macro/hotkey
program for windows 3.1 called "whiskers". It used to be available on
CompuServe in the IBMSYS or IBMAPPS forums as shareware. With this program
I can configure hotkeys to launch the switchto/switchtp commands and the
hotkeys are valid no matter what program is active in windows (i.e. you don't
have to bring program manager up before you can hotkey). Another shareware
program I use (and registered long ago) is Plugins for Program Manager, by
Planet Crafters. Its available on the web and the CompuServe winshare forum.
It can be configured to popup via a hotkey a menu list of programs that it
will launch. The programs on this menu are fully user configurable.
You could use this popup menu to hotkey launch these switchto/switchtp
commands. There are probably many other windows 3.1 utilities that can be
used to do what needs to be done.
7. Configuring a full screen DOS session to hotkey switch to another session
is a little trickier because unlike in windows there is no direct way to
launch a program from the DOS program you might be running. However, where
there is a will there is a way!!
8. First you need to use Popup 1.14 a DOS utility included in this zip file.
Popup is a shareware program. This is a DOS TSR utility you load as part of
your autoexec.bat for your DOS sessions. It takes only 7k of ram. Do NOT
load it high. It won't work. This utility can be configured to popup via
hotkey a DOS command line OR it can be configured to LAUNCH a program
immediately upon popping up!! With this feature you can create a method to
hotkey from a full screen DOS session to any other full screen or PM session!!
9. For example in my autoexec.bat file in the root directory of my OS/2
boot drive I have the following line:
c:\popup\popup -cc:\popup\switch.com -pe:\win\temp -n -a -4 -m128 -HC:A
The above line loads the PopUp.exe program and tells it to run the
program I created called "switch.com" immediately upon popping up. (More
about "switch.com" in a moment). It further tells Popup to store any temp
files it creates in the e:\win\temp directory, that popping up over
extended text mode screens is allowed, and that it should only allocate and
swap out 128k of memory (you can make popup swap out much more memory but
128k is all that is needed and the less it has to swap the more
instantaneous the swapping). My hotkey is ctrl-A. On my 486 120mhz
computer Popup's handling of the hotkey and switching is instantaneous. It
pops up and executes the switching command just as fast as I can press the
key combination. It works beautifully!!!
10. Now about switch.com. Switch.com is a compiled batch file. I compiled
it with the freeware PC Mag utility called bat2exe by Doug Boling.
This program should still be available to download from ziff on CompuServe or
from the ziff website. You can configure popup to execute a plain batch file
if you can't get bat2exe or some other batch file compiler, but a compiled
batch file is faster because popup doesn't have to first start command.com
before executing the batch file.
11. This is what the batch file/source code looks like which I compiled into
switch.com. You could adapt it for your use if you desire.
@echo off
@echo
@echo
@echo Select Program To Switch To
@echo
@echo
@echo 2 = Xtpro
@echo 6 = Labelpro
@echo A = Rolodex
@echo C = Calculator
@echo K = Sidekick
@echo L = LaunchPad
@echo O = Ozcis
@echo W = Word
@echo Y = TN
@echo
@echo
REM I am using the choice.com program from DOS 6.x. It works fine under OS/2
c:\dos\choice.com /c:kowlc2y6an /n Press N To Abort Switching
If errorlevel 10 goto end
If errorlevel 9 goto rolodex
If errorlevel 8 goto winlabel
If errorlevel 7 goto tn
If errorlevel 6 goto xtpro
If errorlevel 5 goto calculator
If errorlevel 4 goto launchpad
If errorlevel 3 goto word
If errorlevel 2 goto ozwin
If errorlevel 1 goto sidekick
goto end
:sidekick
c:\utility\switchto sidekick
goto end
:ozwin
c:\utility\switchto ozwin
goto end
:word
c:\utility\switchtp "microsoft word"
goto end
(Part of batch file omitted to save length)
:end
@echo on
12. When popup is activated via its hotkey, it automatically runs
switch.com which allows me to select whatever other full screen or PM
session that I have configured to jump to. As I said before the popping
up is so fast that I am unable to press the keys to popup and switch faster
than the program can handle. No waiting, instantaneous hotkeying from any
full screen DOS session!!!
13. One last note. For some reason switchtp doesn't like it if it is used
in a full screen DOS session which has background processing turned OFF.
You switch away O.K., but when you come back the DOS session's video will
be corrupted. This is completely solved by turning background processing
ON. (Note that switchtp works fine with background processing turned OFF
for full screen windows sessions? Go figure! <g>)
14. You will note when using the switchto/switchtp programs as described
above, that when you switch from one full screen program to another
full screen program that you are first brought to your desktop and then to
the full screen program you are jumping to. It works quite fast and is
automatic, but if you don't like seeing the desktop momentarily during the
switching process there is a way to go directly from one full screen
session to the next full screen session. I've saved this for the end
because it is optional and might confuse some, but isn't that hard really.
15. To jump directly from one full screen session to another you must use
a program that allows you to start an OS/2 session in the background from a
DOS or windows session. Included with this file is a freeware OS/2 utility
that works quite elegantly for this. It is called OS2EXE.ZIP. Inside
OS2EXE.ZIP are two programs OS2EXEC.EXE and OS2EXECD.EXE. If you run any
full screen windows sessions you need to load 2 copies of os2execd.exe from
your startup folder. Just create two different objects for os2execd.exe and
make sure you select under the window settings tab that the object when run
will run a NEW session of the program. Also, make sure you put the -v switch
on the parameters line of the settings notebook for these objects. This will
let you see more detail about how these programs work. Once you have these
programs working you can set them to run minimized, but at first don't
minimize them until you understand how things work and you have everything
working.
16. OS2EXEC.EXE is a DOS program that you run from your full screen DOS
sessions. What os2execd.exe does is open a named pipe that os2exec.exe or
any program that can write to a file can communicate with. What os2exec.exe
does is pass through to os2execd.exe the name of a program to run.
Os2execd.exe then runs the program in the background. Of course the program
you tell it to run is switchto. Switchto is run in the background and you
switch directly from one full screen session to another full screen session.
17. Here is an example of what the os2exec.exe lines in my switch.com file
look like. (Switch.com is discussed in detail above)
:xtpro
c:\utility\os2exec.exe -x c:\utility\switchto.exe xtg
goto end
:tn
c:\utility\os2exec.exe -x c:\utility\switchto.exe wintn
goto end
Note the use of the -x switch above. The -x switch tells os2execd.exe to run
the switchto program directly without invoking OS/2 cmd.exe first.
O.K. now you know how to setup direct hotkeying from a Full Screen DOS session
to any other Full Screen session. Now I will explain how to setup a Full
Screen Windows Session.
18. Setting up a full screen windows session is a little trickier because
you can't just launch os2exec.exe from windows. If you do you will be
switched to your desktop while OS/2 loads a DOS session and then runs the
DOS program os2exec.exe. This defeats the objective of jumping directly from
a full screen windows session to another full screen session.
19. There is a solution however. OS2EXECD.EXE will accept commands not just
from os2exec.exe but from any program that can write to a file. Therefore,
what is needed is a windows program that can write to a file. I use the
freeware windows 3.1 windows batch program called WINCMD. WINCMD is again
a PC Mag freeware utility written by Doug Boling. It is available from Ziff
on CompuServe and from Ziff's web site.
For each full screen session that you might want to jump to from a full screen
windows session you must configure a separate wincmd batch file. Below is the
wincmd batch file I use to switch from full screen windows to full screen
Xtree Gold Pro. I call it SXTG.WCM. The WCM extension is required by the
wincmd program. The commands in SXTG.WCM file are exactly as follows:
hfile = FileOpen(f:\pipe\os2exec.em,file_readwrite)
FileWrite(hfile,"00Xc:\utility\switchto.exe xtg")
delay(500)
FileWrite(hfile,"00A")
delay(500)
exit
What this windows batch file does is first open the named pipe file used by
os2execd.exe. Since OS/2 is on my F drive I use "f:\pipe\os2exec.em", you
should substitute the letter of your OS/2 boot drive for f: in the line above.
After opening the named pipe for read/write operations the next line
writes to the named pipe "00Xc:\utility\switchto.exe xtg". The 00X are
special commands that os2execd.exe needs and should stay the same on your
machine. Substitute the appropriate drive and path to switchto.exe based
upon where you keep switchto.exe on your computer. Next the wincmd program
pauses for 500 milliseconds. Then it sends to the named pipe "00A" (That is
zero zero A) which tells os2execd.exe to reset the named pipe to await the
receipt of a new command. Then the batch file pauses again for 500
milliseconds, and then it exits. I found that the pauses were necessary to
get wincmd and os2execd.exe working together properly.
O.K. now that you have wincmd (or other windows program that can perform the
above operations) setup and you have written your version of SXTG.WCM then all
you have to do is follow the instructions above to assign a hotkey in windows
that will launch wincmd.exe. In this specific example it would launch
"wincmd.exe sxtg.wcm". This runs wincmd.exe and tells wincmd.exe to run the
windows batch file sxtg.wcm. On my 486 120mhz computer this all takes place
virtually instantaneously. Then just write a separate *.wcm file for each
full screen session you want to hotkey to from a full screen windows session.
Then assign different hotkeys for each as detailed above.
Well that's it. This tells you all you need to know in order to hotkey from
any full screen DOS/windows session to any other full screen or PM session.
This file was written and uploaded to share my experiences and to help others.
I am not a programmer, but I have benefited from many other programmers
freeware and shareware programs. This is my attempt at giving back something.
Cheers,
Gary Britt
CompuServe ID 72073,2445