home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / hook57.zip / hook.txt < prev    next >
Text File  |  1997-10-05  |  134KB  |  2,739 lines

  1.  
  2.                  >>>>  Contents of README.1st  <<<<
  3.  
  4. Information for HOOK  vs 5.70                          Tue  09-17-96
  5.  
  6. ------------------------------- INSTALLATION -------------------------------
  7.  
  8. From the directory containing the UNZIPPED files as the current directory
  9.  
  10.     type   INSTALL
  11.  
  12. and follow the directions and prompts from the Install Program.
  13.  
  14. !! DO NOT install this into the same directory as any current version    !!
  15. !! of HOOK. If you wish to retain the same name for the directory in     !!
  16. !! which to Install, then move the current content to another directory. !!
  17. !! or rename the directory containing the earlier the current version.   !!
  18.  
  19. !!! AFTER HOOK is installed DO NOT rename the  directory or any of the  !!!
  20. !!! files relating to HOOK. When HOOK is installed it copies the name   !!!
  21. !!! of the directory into which it is installed into HOOK.EXE and that  !!!
  22. !!!           information is required when HOOK is loaded,              !!!
  23.  
  24. I believe this version has all the problems with switching to loaded
  25. Hot Key programs fixed as well as the maintenance of the files
  26. HOOK.INI and HOOK.HKY. It has modified the way PM type programs
  27. are handled and includes new HOOK window messages and display behavior.
  28. When a Program is FIRST loaded by HOOK, the HOOK window will FLASH and
  29. display the Message HOOK BUSY until the critical part of the program load
  30. has occured. When the HOOK window stops flashing then it is safe to active
  31. another HotKey.  The time for a Program to Load is highly dependent on
  32. the particular program and happen almost instantaneously or take seconds
  33. to complete. This version of HOOK attempts to serialize the loading of
  34. programs so that a new program load is not started until the current
  35. program being loaded has completed it load.
  36.  
  37. >>>  Built In HotKey to Inactivate HotKeys now is Shift-Ctrl-SpaceBar  <<<
  38. >>>     This is a change from  Shift-Alt-5 which is no longer used     <<<
  39.  
  40. NB:There is now an option to Turn Off the  Beeps accompanying the
  41.    Flashing. HOOK Window when a Program is Loaded.
  42.  
  43. There are some very few programs that do not install into the Task List.
  44. Since HOOK uses the Task List for its information on Program Loading and
  45. Unloading these cause a problem. That is handled by the use of a Timer.
  46. When any HOOK program is loaded, a Timer is started that turns off the
  47. Flashing Window and resets some other crucial parameters of HOOK so that
  48. it will continue to function normally. This time delay is set at 10
  49. seconds.
  50.  
  51. I have included a section in HOOK.INF (HOOK.TXT) on how HOOK works.
  52.  
  53. This is a significantly Updated Version and you should read the documentation
  54. before Installing or Using It.
  55.  
  56. Significant Capabilities have been added to HOOK.
  57.  
  58. New   A mapping of the HotKey Combinations has been made to create an
  59. 5.7   option to the Shift-Alt-X,Shift-Ctl-X,Alt-Ctl-X that is just a
  60.       two key combination Key-X. The purpose is to by pass conflicts
  61.       with program defined combinations using Alt-X or Ctl-X keys.
  62.       The current combinations are still in effect but the new Key-X
  63.       combinations can be used in place of them.
  64.  
  65.       The mappings are:  Shift-Alt-X   ->  ScrollLock-X
  66.                          Shift-Ctl-X   ->     NumLock-X
  67.                            Alt-Ctl-X   ->       Pause-X
  68.  
  69.       Keyboard handling is done so that if the alternates are used,
  70.       their state (and the LED state) is maintained.
  71.  
  72. >>    This modification makes the use of the Alt-Pause,Shift-Pause
  73. >>    unnecessary but it is still supported. However, the addition of
  74. >>    the Pause Key as a Hot-Key makes its use with Alt/Shift cumbersome
  75. >>    requiring multiple entries to access it. Its use is not recommended.
  76.  
  77. NEW   A PASTE mode has been added to HOOK. The built in HotKey
  78. 5.7   Shift-Alt-SpaceBat toggles this mode On/Off. When the PASTE Mode
  79.       is Active the HOOK oowindow Flashes and the Title Bar is changed
  80.       to display PASTE.
  81.  
  82.       When ON the HotKeys (user defined) PASTE user defined text into
  83.       the current window. The text to paste is defined by the User using
  84.       the same HotKey sequences as for the normal Hot-Key operation and
  85.       activated by the HotKey assigned to that Text.
  86.  
  87.       The Text string, is in a formatted form using <...> to allow the
  88.       inclusion of various Control Keys (in general these are recognized
  89.       only in PM windows) and the total string length is up to 296
  90.       Characters. Each string may have a Description attached to it and
  91.       these descriptions can be displayed using the same key
  92.       combinations (in the Paste Mode) as used for the Normal HotKeys.
  93.  
  94. NEW   HOOK will read in a formatted Text File that allows Control type
  95. 5.5   keys to be pasted into PM windows(that accept text). The same
  96.       type of formatting can also be assigned to a HotKey if it is
  97.       preceeded by a ':'. The formatting is of the form <KeyName>
  98.       where KeyName is usually the label on the Keyboard. Included
  99.       also is a <Wait> and a <DosBeep> option formatted as
  100.       <Wait ###.###> and <! freq,duration>. There is also a comment
  101.       option formatted as <* Comment>
  102.  
  103.       Reading in the formatted Text File is initiated by Shift-Alt-F5
  104.       which brings up a FileDialog Window to obtain the name of the file.
  105.  
  106.       See the OnLine Help File Under   HOT-KEY Assignments-Fixed by Program
  107.  
  108. NEW   An ICON to start HOOK will now be installed by the INSTALL Program.
  109. 5.0
  110.  
  111. REDESIGN of Access to HotKey Menu for Assigning HotKey
  112.       Shift-Alt-F3 now brings up Window Prompting User to Type In
  113.       Hot-Key to Assign/Edit and identifies HotKeys
  114.  
  115. ASSIGN HotKey to Window on DeskTop (OS/2 PM and TEXT only)
  116.       Assigned to Hot-Key Shift-Alt-F9
  117.  
  118.  
  119. CLOSE All Program Started by HOOK - Assigned to Shift-Ctrl-Del
  120.       This option will close all programs that were loaded from a
  121.       HOOK Hot Key.
  122.  
  123. CLOSE Active Program - Assigned to Alt-Ctrl-End
  124.       This will close the Active Window (PM,OS/2 or DOS)
  125.  
  126. PASS  STARTUP HOT KEY to HOOK to Call After Loaded
  127.        When Hook is loaded a HotKey to Execute by HOOK can be passed
  128.        to HOOK on the Command Line to Execute after HOOK is loaded.
  129.  
  130. PASTE TEXT STRINGS INTO Windows
  131.        Text Strings may be assigned to HotKeys and when that HotKey is
  132.        struck the assigned text is pasted into the window with the
  133.        Keyboard Focus. There are two options for this. One pastes very
  134.        rapidly and the other with a very small time delay between
  135.        characters om the string.
  136.  
  137. EXECUTE SEQUENCES OF HOT Keys
  138.        This is a macro like capability that does not require recording.
  139.        A sequence of HotKeys may be assigned to a single HotKey and all
  140.        will be executed when that HotKey is struck. BE sure and read
  141.        the documentation on this.
  142.  
  143. SCHEDULE Hot Keys Option
  144.        This is a completely new addition which allows the user to
  145.        Schedule any assigned Hot Key for execution at a specified
  146.        time (hh:mm AM or PM) on any, all or selected days of the
  147.        week. At the  specified time the  program is executed just
  148.        as if the Hot Key key strokes had been entered at the Keyboard.
  149.  
  150.    IN ADDITION PLEASE NOTE THE FOLLOWING CHANGES FROM EARLIER VERSIONS
  151.  
  152. MACRO RECORDING now omits WM_MOUSEMOVE messages.
  153.          This speeds up playback and loses nothing since those messages
  154.          just display the mouse pointer moving from one location to
  155.          another. The actions at the end of that are unchanged.
  156.  
  157. MACRO PLAYBACK started by Shift-Ctrl-Ins within HOOK may be terminated
  158.          by pressing the Esc Key.
  159.  
  160. PLAYKEYS.EXE IS NO LONGER INCLUDED.
  161.          The format of this program is not compatible with the new
  162.          installation of HOOK BUT more importantly, its task has been
  163.          superseded by the PASTE TEXT STRINGS INTO Windows option.
  164.  
  165. HOOKQDLL.DLL HAS BEEN CHANGED.
  166.          The change is required to accomodate a new configuration parameter.
  167.          See below for those additions.
  168.  
  169. HOOK.INI HAS BEEN CHANGED.
  170.          In order to save the additional configuration parameters HOOK.INI
  171.          has increased in size. In addition some reserve bytes have been
  172.          added for potential future use.
  173.  
  174. HOOK DISPLAY WINDOW
  175.          Now displays messages when HOOK is loading/switching programs.
  176.          Message indicates that a program is being loaded or if
  177.          switching the technique used for Switching .i.e.SwitchList Handle.
  178.          (the Task List title is no longer used by HOOK).
  179.  
  180. USER ASSIGNABLE HOT-KEYS ADDED
  181.          Two new user assignable Hot Keys have been added. This results
  182.          in HOOK.HKY increasing in size by 2*278 bytes. They are 2-Char
  183.          Hot-Keys  Alt-Pause and Shift-Pause. In HOOK.DAT they may
  184.          entered as Pse-A and Pse-S for assignment.
  185.  
  186. DEFINE HOT KEYS ENTRY SCREEN
  187.          This has been significantly changed to display current
  188.          assignments of a Hot Key for Editing.
  189.  
  190. HOOK.HKY BINARY FILE STORING HOY-KEY INFORMATION.
  191.          Automatically read in when HOOK loaded and saved when HOOK
  192.          unloaded. If you want to read this, use a HEX editor.
  193.  
  194.          BE sure and use the new one and use HOOK.DAT to read old
  195.          settings back in.
  196.  
  197. HOT-KEY TASK MODIFIED:Shift-Alt-UpArrow
  198.         Shift-Alt-UpArrow no longer reads in HOOK.DAT. It now reads in
  199.         HOOK.HKY from disk.
  200.  
  201. NEW BUILT IN HOT-KEY:Shift-Ctl-Del
  202.         This Hot-Key will CLOSE ALL Programs Started using HOOK.
  203.         It DOES NOT close HOOK. This is a quick way to clean the
  204.         Desk Top.
  205.  
  206. NEW BUILT IN HOT-KEY:Shift-Ctl-UpArrow
  207.         HOOK.DAT is now read in by Shift-Ctl-UpArrow. In addition
  208.         HOOK.DAT is NOT automatically read in when HOOK is loaded but
  209.         may be read in as indicated above. Any assignments in HOOK.DAT
  210.         will overwrite those currently in effect.
  211.  
  212. NEW BUILT IN  HOT-KEY:Alt-Ctrl-Esc
  213.         In this version of HOOK, when HOOK is loaded the 3-Key sequence
  214.         Ctrl-Alt-Del that is used for rebooting is disabled (by using a
  215.         DosDevIOCtl Command). In its place this Hot-Key will display a
  216.         message asking "Do You Really want to REBOOT ?" and informing
  217.         you that if the answer is Yes, it will re-enable Ctl-Alt-Del
  218.         BUT that no HOOK files will be saved. I have included this option
  219.         because the Built in Hot-Keys Shift-Alt-End and Shift-Alt-Del
  220.         may sometimes be inadvertenlty hit as Ctrl-Alt-Del ( I have one it
  221.         on some occasions) and this then will not allow that to happen
  222.         and any attempt to reboot will give you a warning message.
  223.  
  224.         NB. DISABLING Ctl-Alt-Del also DISABLES Alt-Home which in a DOS
  225.         window allow switching between a DOS window and DOS Full Screen.
  226.  
  227.         Some problems may have occured with using OBJOPEN or PLAYBACK
  228.         because of some inconsistencies in Command Line formatting
  229.         between the 4OS2.EXE COMMAND PROCESSOR (which is what I use)
  230.         and CMD.EXE (the default from IBM). These have now been fixed.
  231.  
  232. NEW CONFIGURATION OPTIONS in Shift-Alt-F2 ACTIVATED MENU.
  233.         BEEP accompanying Flashing Window when Program Loaded
  234.           An option is included to turn this OFF or ON(default)
  235.  
  236.         Message Display KeyPad Use Options
  237.           An additional option to toggle OFF/ON the BEEP when HOOK
  238.           is loaded.
  239.  
  240.         New Menu Option for DLL
  241.           Toggle OFF/ON how HOOKQDLL treats WM_CHAR messages. Currently
  242.           WM_CHAR messages indicating a Hot-Key entered from KeyBoard
  243.           are NOT PASSED on to System Message Queue. This option allows
  244.           that behavior to be changed.
  245.  
  246.         Display Scheduled Hot Keys
  247.           This lists on the screen the Hot Keys that are currently
  248.           scheduled and the specifics of the Schedule for that Hot Key.
  249.           (see above for that new option)
  250.  
  251. This version is backward compatible with earlier versions except as
  252. noted above with respect to the files HOOKQDLL.DLL, HOOK.INI  and
  253. HOOK.HKY .
  254.  
  255. The INSTALL program has been modified to copy the readme.1st file to
  256. the target directory as well as the two DLL files. The DLL files are
  257. now no longer in \OS2\DLL but in the directory specified as the target
  258. directory to hold the HOOK files. The only REQUIREMENT for LIBPATH is
  259. that the first entry should be  ".;"  , i.e. the default directory.
  260.  
  261. The Install program will now accept any valid directory name sequence
  262. up to 60 characters (including the drive  specificaton) in length.
  263.  
  264. Users booting OS/2 from a logical drive and with multiple versions
  265. existing should no longer have any problems. Just be sure that the
  266. active CONFIG.SYS has in its LIBPATH  command ".;" as the first entry.
  267.  
  268. All of these aspects and many more are detailed in the either of the
  269. two documenting files below.
  270.  
  271. The two files  HOOK.TXT and HOOK.INF contain the same information but
  272. HOOK.TXT is an ASCII text file and can be displayed with any Text Editor,
  273. List command or the DOS type command.
  274.  
  275. HOOK.INF is an OS/2 PM file and can be viewed with the OS/2 view.exe
  276. program. That program is by default in the \os2 directory on the
  277. drive on which OS/2 is installed and \OS2 is almost certainly in the
  278. Path listing. To view HOOK.INF with VIEW just enter from an OS/2 command
  279. line where the default directory has HOOK.INF    View hook.
  280.  
  281. Either file contains instructions on Installation of HOOK as well as
  282. details about its use.
  283.  
  284. If you want to use the assignments in an existing HOOK.DAT file, after
  285. this new version is installed, copy that file to the directory holding
  286. HOOK.EXE. When HOOK is loaded use Shift-Ctrl-UpArrow to read in that file.
  287. Then use Shift-Alt-DnArrow to save the assignments just readin into
  288. HOOK.HKY.
  289.  
  290. Thu  06-06-96
  291.  
  292. Morton F. Kaplon
  293.  
  294.                >>>> END - Contents of REAME.1st - END <<<<
  295.  
  296. Contents of HOOK57.ZIP
  297.  
  298.  FileName      Description of File
  299.  DOSERDLL.DLL  Dynamic Load MOdule - For DOS API Error Messages
  300.  HOOKQDLL.DLL  Dynamic Load Module - intercepts system message queue (Updated)
  301.  HOOK.DAT      Sample Optional data file for hot-key assignments - read by HOOK.EXE
  302.  HOOK.EXE      Executable File - Executes According to Key Combinations Struck
  303.  HOOK.INI      Binary file read by HOOK; has configuration data for HOOK.
  304.  HOOK.INF      INF file displayed by VIEW.EXE - has Help/Information for HOOK
  305.  HOOK.HKY      Binary File Maintained by HOOK - has Hot Key Assignments
  306.  HOOK.PST      Binary File Maintained by HOOK - has PASTE Assignments
  307.  HOOK.SKD      Binary File Maintained by HOOK - has Hot Key Schedule Assignments
  308.  HOOK.TXT      ASCII File with instructions on installing and using HOOK
  309.  INSTALL.EXE   Complete Install of HOOK including target drive and directory.
  310.  KEYBD.ICO     Icon Bitmap for a KeyBoard
  311.  OBJOPEN.EXE   Program that opens Folders from Command Line
  312.  OBJOPEN.DOC   Document File for OBJOPEN.EXE
  313.  PLAYBACK.EXE  PlaysBack Hook created Macros from Command Line
  314.  PLAYBAKF.EXE  PlaysBack Hook created Macros from Command Line FASTER
  315.  PLAYBACK.DOC  Document File for PLAYBACK.EXE and PLAYBAKF.EXE
  316.  README.1ST    Readme File with brief listing of changes in Vs. 5.60
  317.  TASKLIST.EXE  Displays Total Content of Switch Control Structure
  318.  THUNKER.DLL   DLL Needed for TASKLIST.EXE - User Should Copy to \os2\dll
  319.  
  320.  The INSTALL program copies the 8 files hook.* listed above, the two DLL
  321.  files and README.1st to the Directory and Drive specified by you at
  322.  Install Time and then establishes an ICON for HOOK on the desktop.
  323.  
  324.  The 5 files listed below it are  special programs and their
  325.  documentation files. These carry out specific tasks.  You should
  326.  copy them to a directory of your choice (which could of course be
  327.  the directory you install HOOK into).
  328.  
  329.  The file TASKLIST.EXE displays the content of the Switch List Control
  330.  structure maintained by OS/2.Since it displays data for programs that
  331.  have had the Not Visible Flag set in the structure, it will contain
  332.  more listings than the Task List displayed by Ctrl-Esc. For it to
  333.  be used the file THUNKER.DLL must be in the \os2\dll directory. The
  334.  user should copy it to that directory.
  335.  
  336.  Install.EXE copies the 7 files named HOOK, the two DLL files and
  337.  Readme.1st to X:\HOOKDir\ where X: is the drive ID entered into the
  338.  Install Window and HOOKdir is the directory name entered (C:HOOK is
  339.  default). X:\HOOKdir can be up to 60 characters in length.
  340.  
  341.  HOOK.EXE can be started from an OS/2 command Line as  X:\Hookdir\hook
  342.  where X and HOOKdir are as defined above.  An additional requirmeent is
  343.  that the LIBPATH statement in CONFIG.SYS must have ".;" as the first
  344.  entry in it. This should be the default setting but check it
  345.  nonetheless.
  346.  
  347.  Some users have multiple versions of OS/2 and in some cases may BOOT
  348.  one of these from a Logical drive. In that case you must be sure that
  349.  the CONFIG.SYS file used on the boot drive has ".;" as the first entry
  350.  in the LIBPATH statement.
  351.  
  352.                             AN OVERALL VIEW
  353.  ------------------- What HOOK does and How HOOK Works -----------------------
  354.  
  355. HOOK is a program that has two major functions.
  356.  
  357. HOTKEY FUNCTION:In this role, when a certain combination of Keystrokes
  358.                 is entered at the Keyboard, HOOK either starts a program
  359.                 associated (by the user via a Screen Dialogue) with that
  360.                 Keystroke combination OR if that program was already
  361.                 started by HOOK, it Switches to it to make that the
  362.                 active program. HOOK will open or switch to a Full
  363.                 Screen program from the Desktop but will not switch back
  364.                 from the FullScreen to the DeskTop. The user must
  365.                 activate the Task List (Ctrl-Esc) to return to the
  366.                 DeskTop from Full Screen for HOOK to be effective.
  367.  
  368.                 The HotKeys are of two types:
  369.  
  370.                 1-Set by the HOOK program to effect specified tasks - these
  371.                   are not available to the user for assignment.
  372.  
  373.                 2-Assignable by the user to open/switch to any of the
  374.                   following types of programs:
  375.  
  376.                   OS/2 VioType Programs  Windowed or FullScreen* (text type)
  377.                   OS/2 PM      Programs. Inherently windowed.
  378.                   OS/2 CMD     Programs. These must be passed as a
  379.                                          command line parameter to the
  380.                                          OS/2 command processor.
  381.                   DOS          Programs  Windowed or FullScreen*.
  382.                                          Includes COM EXE and BAT files,
  383.                                          and Windows 3.x
  384.  
  385.                  * Note the comment in the preceeding paragraph. HOOK
  386.                    will not Switch Back directly from FullScreen. The
  387.                    user must use Ctrl-Esc to get to the DeskTop from
  388.                    which HOOK is active or for DOS programs Alt-Home
  389.                    will window a Full Screen program (if it is
  390.                    compatible with a Windowed Session).
  391.  
  392.                 The Keystroke combinations HOOK offers for Assignment
  393.                 of Programs  are: (X is 0,1,.....8,9  A,B,....Y,Z)
  394.  
  395.                 Shift-Alt-X denoted as Alt-X  36  Key combinations
  396.                 Shift-Ctl-X denoted as Ctl-X  36  Key combinations
  397.                 Alt-Ctl-X   denoted as Qac-X  36  Key combinations
  398.                 Alt-Pause   denoted as Pse-A   1  Key combination
  399.                 Shift-Pause denoted as Pse-S   1  Key combination
  400.  
  401.                            Total Assignable  110  Key combinations
  402.  
  403. NEW             Because many programs do not filter the KeyStroke combinations
  404. 5.7             completely, they will respond to a Shift-Alt-X or Shift-Ctrl-X
  405.                 or Ctrl-Alt-X if any of the Alt-X or Ctrl-X combinations hs
  406.                 been pressed and thus the HotKey actions are intercepted
  407.                 and have to be entered again or hit twice in successions.
  408.  
  409.                 To bypass this a set of alternate Single Key mappings
  410.                 from the Key-Key-X combination has been made such that
  411.                 none of the Keys are Alt or Ctrl Keys.
  412.  
  413.  The mappings are:  Shift-Alt-X   ->  ScrollLock-X
  414.                     Shift-Ctl-X   ->     NumLock-X
  415.                     Alt-Ctl-X     ->       Pause-X
  416.  
  417.                     NB: Alt-Pause and Shift-Pause have not been mapped.
  418.  
  419.                 Keyboard handling is done so that if the alternates are
  420.                 used, their shift state and corresponding LED state is
  421.                 maintained.
  422.  
  423. MACRO  FUNCTION:In this role, HOOK starts recording ALL Keystroke, mouse
  424.                 and other activity producing messages and storing it in
  425.                 memory. When the user indicates that recording should
  426.                 stop HOOK presents the User with the option of storing
  427.                 the data recorded in 2 files representing the data in
  428.                 both Binary and ASCII format; the user assigns the file
  429.                 prefix and the extensionns are  HEX/MAC for the
  430.                 binary/ASCII version. A given Macro can be replayed by
  431.                 HOOK by loading it from Disk to Memory or by using the
  432.                 included program PLAYBACK.EXE to playback the Macro by
  433.                 using it as PLAYBACK MACRONAM.HEX either from the
  434.                 Command Line or assigned to a Hot Key.
  435.  
  436.   To accomplish these functions HOOK utilizes 2 execution units,
  437.   HOOK.EXE and HOOKQDLL.DLL referred to hereafter as HOOK and DLL
  438.   respectively and uses several additional files to store configuration
  439.   options, the actual user defined HotKey assignments and the macro
  440.   files.
  441.  
  442.   HOOK.INI     Binary format,stores user selected configuration parameters.
  443.  
  444.   HOOK.HKY     Binary format, stores HotKey assignments made by the user
  445.                from an on Screen Dialog.
  446.  
  447.   HOOK.DAT     ASCII file, the user may use to enter HotKey assignments.
  448.                It exists for compatibility with earlier versions.
  449.  
  450.   UsrName.HEX  Binary format, stores data for a given Macro.
  451.   UsrName.MAC  ASCII  format, stores data for a given Macro.
  452.  
  453.   The DLL is the equivalent of a DOS TSR program. When HOOK is started,
  454.   it loads the DLL into memory and the two functions indicated above are
  455.   carrried out cooperatively by the DLL and HOOK. When HOOK is exited,
  456.   the DLL is unloaded from memory.
  457.  
  458.   The DLL is primarily a DETECTION unit whose principal function is to
  459.   monitor the system message queue and inform HOOK when certain
  460.   parameters are detected in a message. HOOK is primarily an Execution
  461.   unit carrying out tasks based on what the DLL detected.
  462.  
  463.   The DLL and HOOK communicate with each other in several ways.
  464.      1-Way Paths: from DLL -> HOOK using the System Message Queue.
  465.  
  466.      2-Way Paths: a-Shared memory space between the DLL and HOOK;
  467.                   b-HOOK calls functions residing in the DLL passing
  468.                     parameters to it in registers; the DLL returns
  469.                     values to HOOK in registers.
  470.  
  471.  ------------------------------ The DLL -------------------------------
  472.  
  473. DLL means Dynamic Link Library. In this application it can be thought of
  474. as the equivalent of a TSR in DOS. That is, it is loaded into memory by
  475. HOOK when the program is called and remains there until HOOK is exited,
  476. when it is unloaded.
  477.  
  478. The DLL intercepts the system message Queue.
  479.  
  480. HOTKEY FUNCTION:Is the default action. It examines messages with
  481.                 MessageID = WM_CHAR, since it is these that carry all
  482.                 information about Keyboard activity and messages with
  483.                 MessageID = 2F43H (an undocumented message described
  484.                 below).
  485.  
  486.   MessageID = WM_CHAR
  487.  
  488.   For each WM_CHAR message the DLL determines the following:
  489.  
  490.   Did there exist any of the following Key Stroke Combinations :
  491.          Shft-Alt-X   X is any key with a valid Scan code
  492.          Shft-Ctl-X   X is any key with a valid Scan code
  493.           Alt-Ctl-X   X is any key with a valid Scan code
  494.           Alt-Pause
  495.          Shft-Pause
  496.  
  497.   If any of those combinations is detected the DLL Posts a Message to
  498.   HOOK using MessageID = WM_USER+300H, with parameters indicating which
  499.   of the 5 Key combinations was struck; the parameters are defined as:
  500.  
  501.     --HotKey--   --MessageID-    Parm1    ----Parm2------------
  502.     Shft-Alt-X   WM_USER+300H    0000H    ScanCode of X     Key
  503.     Shft-Ctl-X   WM_USER+300H    0001H    ScanCode of X     Key
  504.      Alt-Ctl-X   WM_USER+300H    0002H    ScanCode of X     Key
  505.      Alt-Pause   WM_USER+300H    0003H    ScanCode of Pause Key
  506.     Shft-Pause   WM_USER+300H    0103H    ScanCode of Pause Key
  507.  
  508.   It then DISCARDS that WM_CHAR message. That is, it does not pass it
  509.   along to the next Queue. The reason for this is that almost all
  510.   programs use Hot Key combinations of the form Alt-X and/or Ctl-X . IF
  511.   the WM_CHAR messages for the Hot Key combinations above were passed
  512.   along to the message queue, then every time you entered a Hot Key
  513.   combination, if the active window at that time used Alt-X or Ctl-X of
  514.   the Hot Key Combination, it would be activated for that program in
  515.   addition to activating the HotKey and that is not a very comfortable
  516.   environment in which to function.
  517.  
  518.   Nonetheless I have included a Configuration Option which allows the
  519.   user to Toggle DISCARDING the WM_CHAR messages OFF/ON, the default
  520.   being DISCARD ON.
  521.  
  522.   MessageID = 2F43H
  523.  
  524.   For each 2F43H message the DLL detects it Posts a Message to HOOK with
  525.   parameters as follows:
  526.  
  527.   ----Parm1---  ----Parm2----  -------Parm3------  -------Parm4------
  528.   HOOK_Handle   WM_USER+305H   Parm3 of 2F43H msg  Parm4 of 2F43H msg
  529.  
  530.   2F43H is an undocumented message (in existence and unchanged since vs.
  531.   2.0) that is sent to the TaskList / SwitchList. (I use the names
  532.   interchangeably). It informs the TaskList when a Program is activated
  533.   and added to the TaskList and when a Program is closed and removed
  534.   from the TaskList. In each case the TaskList Handle of the program is
  535.   contained in Parm4 of the message and the value in Parm3 indicates
  536.   what the action is for the program associated with that TaskList
  537.   Handle.
  538.  
  539.   The relevant parameters used by HOOK are:
  540.  
  541.   MessageID TargetWindow  --Parm3--   --Parm4--  -------Meaning--------
  542.     2F43H     TaskList    00000001H    TLHandle  Program Added to TaskList
  543.     2F43H     TaskList    00010001H    TLHandle  Program Added to TaskList
  544.     2F43H     TaskList    00000002H    TLHandle  Issued after above Case
  545.     2F43H     TaskList    00000003H    TLHandle  Program Removed from TaskList
  546.  
  547.   These messages are used by HOOK to obtain the TaskList and Window
  548.   Handles of newly loaded programs. When the message indicating Program
  549.   Removal from the TaskList is received the asssociated HotKey has both
  550.   its TaskList Handle and Window Handle set to NULL.
  551.  
  552. MACRO  FUNCTION:Initiated and concluded by signal from HOOK. In addition
  553.                 to WM_CHAR messages it stores all messages but WM_TIMER
  554.                 and WM_MOUSEMOVE in the shared Memory area. (These are
  555.                 so numerous that they would quickly exhaust that space
  556.                 and their omission does not effect MactoPlayback.)
  557.  
  558. MACRO RECORDING:Initiated when the DLL receives a signal from HOOK. HOOK
  559.          ON     sends that signal when the User hits the Keystroke
  560.                 combination Shift-Ctl-LeftArrow or Shift-Ctl-[.
  561.  
  562.                 All messages in the system message queue except those
  563.                 with ID WM_TIMER and ID WM_MOUSEMOV Eare stored in the
  564.                 Common memory area by the DLL.
  565.  
  566.                 When the PlayBack is done from within HOOK it may be
  567.                 aborted by pressing the Esc Key  when Playback is
  568.                 displayed in the HOOK Window.
  569.  
  570. MACRO Recording:Concluded when the DLL receives a signal from HOOK. HOOK
  571.          OFF    sends that signal when the User hits the Keystroke
  572.                 combination Shift-Ctl-RightArrow or Shift-Ctl-]. The DLL
  573.                 returns to HOOK the number of Messages recorded.
  574.  
  575.  ------------------------------ HOOK -------------------------------
  576.  
  577. Initialization:When HOOK is loaded it performs the following tasks:
  578.                 1-Creates a Message Queue for HOOK.
  579.                 2-Sets directory for HOOK as that where HOOK.EXE is.
  580.                   (this is why LIBPATH must have "." as first directory
  581.                    so that the DLL's are accessable)
  582.                 3-Loads a DLL for Error messages from OS/2 DOS functions
  583.                 4-Reads in from Disk HOOK.HKY to Memory and initializes
  584.                   certain parameters in the assignments therein.
  585.                 5-Reads in HOOK.INI and sets configuration accordingly.
  586.                 6-Determines the Command Processor used for OS/2
  587.                 7-Creates a Thread for displaying messages from HOOK
  588.                   primarily related to Startup and Macros.
  589.                 8-Creates Thread for displaying HOOK window containing
  590.                   Date and Time and used for Messages relating primarily
  591.                   to HotKey related activities.
  592.                 9-Loads HOOKQDLL.DLL and establishes link with it.
  593.                10-Establishes the Input HOOK for the DLL.
  594.                11-Exchanges Initialization data with DLL.
  595.                12-Starts a Timer (times out every 1/2 second) that is used
  596.                   for loading HotKey Programs that have been queued.
  597.                13-Starts the Message Loop for the Queue used by HOOK.
  598.  
  599. HOTKEY FUNCTION:Programs are loaded using the DOS API DosStartSession
  600.                 with parameters as defined by the user in an On Screen
  601.                 Menu when the Hotkey assignment is made and stored in
  602.                 a resident data structure.
  603.  
  604.                 Active programs are switched to using properties of the
  605.                 SwitchList Control Structure maintained by OS/2. Since
  606.                 HOOK makes intensive use of the TaskList it is worth
  607.                 making some comments about the SwitchList.
  608.  
  609.                -- BEGIN : SwitchList Control Structure and Task List --
  610.  
  611.                 OS/2 for PM maintains a Data Structure called the Switch
  612.                 List Control Structure.  There is an entry in this data
  613.                 structure for each ACTIVE program amd Icom-Views (Open
  614.                 Folders) started by OS/2 PM. This data structure's
  615.                 visible representation is in the so called Task List,
  616.                 the listing of running programs and Icon-Views,
  617.                 presented when Ctrl-Esc is struck. However not all
  618.                 active programs are visible in the Task List becauuse
  619.                 one of the parameters a PM program may set is it's
  620.                 Visibility in the Task List. Many of the programs used
  621.                 by OS/2 are not Visible in the task list and thus not
  622.                 listed. (Included in the HOOK ZIP file is a program
  623.                 TASKLIST.EXE that displays a listing of ALL the programs
  624.                 in that structure, Visible or Not in the Task List ).
  625.  
  626.                 When a program is started it is added to the Switch List
  627.                 Control Structure and a variety of parameters relating
  628.                 to it are set. One of these of particular interest to
  629.                 HOOK is the Switch List Entry Handle. This handle can be
  630.                 used to Switch To the program if it is in the Switch List
  631.                 Control Structure and make it the active program.
  632.  
  633.                 Another parameter is the program Title that appears in the
  634.                 Task List. This title can be Set by the program and if
  635.                 no title is set by the program, OS/2 uses the Name of
  636.                 the EXE program as the Title in the Task List Listing.
  637.  
  638.                 For ALL but PM type programs, once the Title is set when
  639.                 the program is loaded, it cannot be changed. PM type
  640.                 programs can change the Title listing at any time and
  641.                 many do. PM programs may take a significant time to
  642.                 load, and the Task List Title entered for them is not
  643.                 finalized into the Switch List Control Structure until
  644.                 loading is complete. In fact some programs may change
  645.                 the title several times and even dynamically.
  646.  
  647.                 The Switch List Handles assigned by OS/2 are re-usable.
  648.                 The Switch List handle assigned by OS/2 to a program
  649.                 becomes available for re-assignment when that program is
  650.                 unloaded just as Window Handles are.
  651.  
  652.                 OS/2 uses an undocumented message MessageID = 2F43H
  653.                 whose parameters were indicated earlier. This message
  654.                 informs the Task List when a program is first loaded
  655.                 and when it is Unloaded and contains its Task List
  656.                 Handle as one of its parameters. HOOK uses that
  657.                 information to set values in its record base for Hot
  658.                 Keys as indicated in a table listed above.
  659.  
  660.                  -- END : SwitchList Control Structure and Task List --
  661.  
  662.                 HOOK maintains a Data Structure containing the
  663.                 information entered by the user when assigning Programs
  664.                 to HotKeys as well as Information it obtains relative to
  665.                 an entry from other sources. This structure consists of
  666.                 110 records, each 278 bytes long. This structure is
  667.                 saved in HOOK.HKY.
  668.  
  669.                 The records for Shft-Alt-X  Shft-Ctl-X  Alt-Ctl-X are in
  670.                 consecutive blocks of 36 records. The last two records
  671.                 are Alt-Pause and Shift-Pause in that order. The three
  672.                 main blocks of data are in order Shft-Alt-X  Shft-Ctl-X
  673.                 Alt-Ctl-X. These four record blocks are referred to
  674.                 respectively as SAX, SCX, ACX and ALP.
  675.  
  676.                 The elements of the Structure with their offsets into
  677.                 each record are:
  678.                    Ofst
  679.        S_TotDescr   000 I ;Address for DosStartSession
  680.        S_HKID       004 U ;The Hot Key X character
  681.       *S_Desc       006 U ;Program Description
  682.        S_ProcID     056 I ;ProcessID from Task List
  683.        S_AppType    060 P ;From DosQuery AppTyhpe using Prog Name and Path
  684.        S_FlagByte0  061   ;Reserved
  685.        S_FlagByte1  062   ;Reserved
  686.        S_FlagByte2  063   ;Reserved
  687.        S_Program    064 U ;Program Name and Path
  688.        S_CmdLine    128 U ;Command Line Parms
  689.        S_WorkDir    192 U ;Working directory
  690.        S_WHandle    252 I :Window Handle of Loaded Program
  691.        S_TLHandle   256 I ;TaskList Handle Obtained When Prog 1st Loaded
  692.        S_Winx       260 U ;X coord  Lower Left WindowCorner in Pixels
  693.        S_Winy       262 U ;Y coord  Lower Left WindowCorner in Pixels
  694.        S_WinWidth   264 U ;Width of Window in Pixels
  695.        S_WinHeight  266 U ;Height of Window in Pixels
  696.        S_SessType   268 U ;Session type
  697.        S_ProgFlag   270 P ;0/'P' No/Yes Program entered
  698.        S_HKSTatus   271 P ;Hot Key STatus 0/'A' = Not/Yes Assigned
  699.        S_DescFlag   272 P ;0=No Desc,'D'/'3'= Desc|TaskListTitle for PM apps
  700.        S_WDirFlag   273 P ;'Z' if Working Dir  entered else 0
  701.        S_CLFlag     274 P ;'C' if Command Line entered else 0
  702.                     275   ;Reserved
  703.                     276   ;Carriage Return Line Feed Record Terminator
  704.  
  705.                 U means Entered by User
  706.                 P means determined by HOOK from parameters entered
  707.                 I means internal Information obtained by HOOK
  708.  
  709. Event Sequence  When HOOK receives a message with ID = WM_USER+300H
  710.                 that messeage is from the DLL and has information
  711.                 on the parameters of a HotKey combination.
  712.  
  713.                 HOOK first determines if the HotKey combination is one
  714.                 of those used by HOOK itself and if so carries out that
  715.                 predefined action and awaits another message.
  716.  
  717.                 IF the HotKey combination is not one of those used by
  718.                 HOOK it may be a User Assignable one. HOOK uses the
  719.                 Parm1 (HotKey Type) and Parm2 (KB ScanCode) to determine
  720.                 the offset into the record structure for that Hot Key.
  721.                 It checks a FLag set in the data structure (S_ProgFlag)
  722.                 for that HotKey to see if an assignment has been made to
  723.                 it. If not it does nothing, otherwise it obtains the
  724.                 Switch List Handle and does the following in sequence&colon.
  725.  
  726.                 0-If the handle is zero it Loads the program assigned to
  727.                   the Hot Key and Sets a FLag indicating a Program is
  728.                   being Loaded by DosStartSession and the HOOK window will
  729.                   display the message "KB¿ Prog_Load". In  addition the
  730.                   HOOK Window will flash and  ring an alarm and continue
  731.                   until the program load is beyond the critical point
  732.                   related to receiving the MessageID = 2F43H with
  733.                   Parm2 = 2. The next interaction HOOK has with this Hot
  734.                   Key is that drtailed in 2 or 3 below.
  735.  
  736.                   IF another HotKey is activated while the Active Flag
  737.                   is Set, the  parameters of that HotKey are placed into
  738.                   a FIFO List. This list is interrogated every 1/2 second
  739.                   when the Timer Times Out and if there is a program to
  740.                   be loaded and the Busy Flag is not set, it is loaded.
  741.  
  742.                 1-Uses the SwitchList Handle to try to switch to the
  743.                   program. If successful a message will be displayed in
  744.                   the top line of the HOOK window "KB¿ TL-Handle".
  745.  
  746.                 2-If the SwitchList Handle does not switch to the
  747.                   program it displays an error message. Here the
  748.                   user should then check the HotKey assignments.
  749.  
  750.                   When any Program is loaded and added to the Task List
  751.                   the system sends the Task List window the message with
  752.                   MessageID = 2F43H with parameters as noted earlier. IF
  753.                   the Flag indicating HOOK loaded a program is SET, and
  754.                   HOOK receives a message WM_USER + 305H indicating a
  755.                   Program has been added to the Task List, it copies the
  756.                   Switch List handle obtained in Parm4 of the message to
  757.                   the appropriate location in the Hot Key Data Stucture.
  758.  
  759.                 3-Program Loaded by HOOK is unloaded. HOOK receives the
  760.                   message with ID WM_USER+305H with Parm3 = 3 and
  761.                   Parm4 = SwitchListHandle of Program Just closed. HOOK
  762.                   goes thru HotKey records seeking Match with Handle and
  763.                   sets it and its Window Handle both to NULL.
  764.  
  765.  
  766. MACRO FUNCTION: Initiated when User Presses Shft-Ctl-LeftArrow or
  767. Start Recording Shft-Ctl-[. The user is first presented with a message
  768.                 informing him/her to move to the desired starting
  769.                 position using either the Cursor or Mouse. When the user
  770.                 Presses Enter in response to the Message, then a Message
  771.                 "KB¿ Recording" appears in the HOOK window on the top
  772.                 line indicating that recording is active. HOOK calls the
  773.                 DLL passing parameters to it and indicating that Macro
  774.                 recording should begin. Keystroke and Mouse activity are
  775.                 recorded until Shft-Ctl-RightArrow or Shft-Ctl-] is
  776.                 pressed. Ending the recording is an effective way of
  777.                 aborting it.
  778.  
  779.   End Recording When either of the HotKeys indicating Macro Recording
  780.                 should stop is received, the "KB¿ Recording" is removed
  781.                 from the HOOK window and HOOK calls the DLL passing
  782.                 parameters to it that indicate Stop Recording and
  783.                 receiving back the number of records recorded. A
  784.                 dialogue box is then presented the User requesting input
  785.                 for the file name prefix for the Macro just recorded.
  786.                 The user may choose not to save the Macro to file by
  787.                 selecting the Cancel option or may enter a File Name.
  788.                 Two files, containing the binary record (UserName.HEX)
  789.                 and the ASCII record (UesrName.MAC) of the Macro are
  790.                 then saved to disk in the directory chosen (default is
  791.                 the directory containing HOOK).
  792.  
  793.                 At the end of the file dialogue a Message is displayed
  794.                 on the screen informing the user that the Macro (still
  795.                 in memory) may be played back by the HotKey combination
  796.                 Shft-Ctl-Ins and that the Playback mayh be aborted with
  797.                 the ESc Key..
  798.  
  799. Saving a Macro  A macro remains in memory until a new Macro is recorded.
  800.   in Memory     If the user decides that he would like to save that Macro,
  801.                 the Hot Key combination Shft-Ctl-PgDn brings up a file
  802.                 dialogue as above to obtain informaiton on the File Name
  803.                 and directory in which to store it.
  804.  
  805. Play Back Macro The built in HotKey Shft-Ctl-PgUp presents the user with
  806.                 a file dialog box to obtain the Name of the Macro file
  807.                 to Load Into memory. When the user chooses the Macro and
  808.                 presses the OK button on the dialogue Box, the Macro is
  809.                 loaded into memory. It is then played back by pressing
  810.                 the HotKey combination Shft-Ctl-Ins. While the playback
  811.                 occurs the message "KB¿ PlayBack" appears in the HOOK
  812.                 window. When the Playback is concluded, the message is
  813.                 removed from the window. The  PlayBack may be aborted
  814.                 by Pressing the ESc Key.
  815.  
  816.                 A Macro may also be played back using the executable
  817.                 file PLAYBACK.EXE or PLAYBAKF.EXE by passing the name of
  818.                 the macro binary file (MACRONAME.HEX) to it as a command
  819.                 line parameter. This combination may be assigned to a
  820.                 Hot Key for convenience.
  821.  
  822.                 PLAYBAKF.EXE plays back faster than PLAYBACK.EXE does.
  823.  
  824.  --------------------- Content of the saved Macro Files ---------------------
  825.  
  826.  For each message saved by the DLL a record is created that contains the
  827.  following information (in binary) stored in memory. Each of the
  828.  parameters below is 32 bits (4 bytes) long and is the content of each
  829.  Message in the Queue.
  830.  
  831.    Handle  MessageID m sgParam1  msgParam2  msgTime  X_ScreenP  Y_ScreenP
  832.  
  833.  For UserName.HEX the content of the memory is saved in binary form to
  834.  that disk file.
  835.  
  836.  For UserName.MAC each of the parameters above is converted to a Hex
  837.  Number and stored as ########H. Additionally the Handle for that record
  838.  is used as an input to the OS/2 API WinQuerySwitchList to get the Title
  839.  (if any) from OS/2's Task List and is stored as a 24 byte string. Each
  840.  message is separated from the following by a Carriage Return and Line
  841.  Feed. The file contains as its first record the HEADER string:
  842.  
  843. WinHandle MessageID msgParam1 msgParam2 msgTime X_ScreenP Y_ScrrenP TaskListName
  844.  
  845.  Handle is the Handle of the Window to whom the message is directed.
  846.  
  847.  MessageID defines the type of information (WM_CHAR,WM_COMMAND,etc )
  848.  
  849.  msgParam1 and msgParam2 are data uniquely associated with that MessageID.
  850.  
  851.  msgTime is the time of the message.
  852.  
  853.  X_ScreenP and Y_ScreenP are the coordinates of the Pointer.
  854.  
  855.  
  856.  ------------------------- How the PlayBack is Done -------------------------
  857.  
  858.  To play back a Macro, the Macro file in HEX format (UserName.HEX) is
  859.  read into memory and each message is interrogated by HOOK. What HOOK
  860.  does is to take action on a limited nuymber of Message ID's. It does
  861.  look at and attempt to interpret the following message IDs
  862.  
  863.       WM_CHAR
  864.       WM_BUTTON1DOWN  WM_BUTTON1UP  WM_BUTTON1DBLCLK WM_BUTTON1CLICK
  865.       WM_BUTTON1MOTIONSTART  WM_BUTTON1MOTIONEND
  866.       WM_BUTTON2DOWN  WM_BUTTON2UP  WM_BUTTON2DBLCLK WM_BUTTON2CLICK
  867.       WM_BUTTON2MOTIONSTART WM_BUTTON2MOTIONEND
  868.       WM_BEGINDRAG  WM_ENDDRAG
  869.       WM_OPEN  WM_CLOSE WM_SYSCOMMAND WM_COMMAND WM_CONTROL WM_PAINT
  870.       WM_TRANSLATEACCEL   (This is rather flaky and very  program dependent)
  871.       WM_USER+300h --- ID for HOOK.EXE as target
  872.       WM_SIZE  WM_MINMAXFRAME
  873.       TaskList    This is the ID for the Task List determined dynamically.
  874.  
  875.       The problem is that many messages associated with Mouse movements
  876.       depend on the location of the Mouse Pointer on the screen. These
  877.       coordinates are in the recorded message data, but unless the DeskTop
  878.       is set up exactly as it was when the message was recorded, their
  879.       playback can be meaningless or misleading.
  880.  
  881.       In a similar vein, other messages such as WM_PAINT, WM_COMMAND,
  882.       WM_SYSCOMMAND,WM_CLOSE,WM_CONTROL, WM_CLOSE have in the recorded
  883.       message a specific WindowHandle as their target. But those
  884.       window handles are not valid at this juncture so in interpreting
  885.       the Macro I have just used the window with the focus.
  886.  
  887.       To do a really totally faithful job of Macro Recording and Playback
  888.       one would have to, at the time of Recording, obtain the precise
  889.       state of the system with respect to Programs loaded, and what is
  890.       on the Desktop and reinstate that condition before playing back
  891.       the Macro. I have not done that. But what I have done, does do
  892.       a reasonable job with respecvt to WM_CHAR messages and some mouse
  893.       actions.
  894.  
  895.  
  896.   Why HOOK ??
  897.  
  898. HOOK was designed to alleviate the need to clear up the Desktop of OS/2 in 
  899. order to obtain access to Icons to load programs and to facilitate switching 
  900. from one active program to another.
  901.  
  902. I found myself all too frequently having to to minimize some of my active 
  903. programs in order to access the Desktop to load another program that was 
  904. required. Additionally I wanted a quicker way of switching to another 
  905. program than using Alt-Esc to move through active programs until I came to 
  906. the desired one or by accessing the Task List to select the program or my 
  907. using the Mouse to activate an Icon.
  908.  
  909. Conceptually then, HOOK is akin to a DOS TSR. Whereas a DOS TSR is resident 
  910. in Memory, HOOK works through DLLs, DOSERDLL and HOOKQDLL.DLL are loaded 
  911. into memory when HOOK is loaded. 
  912.  
  913. DOSERDLL contains information for display if an Error occurs using an OS/2
  914. DOS function.
  915.  
  916. HOOKQDLL monitors the message queue for WM_CHAR messages, the equivalent of 
  917. a TSR hooking the KB interrupt. WM_CHAR messages contain information on 
  918. Keyboard activity and HOOKQDLL, depending on the Keyboard Activity sends 
  919. messages to HOOK which executes according to the key combinations struck as 
  920. defined in the file HOOK.HKY (new feature) which is maintained by HOOK.EXE.
  921.  
  922. OS/2 itself by default assigns a variety of actions to Keystrokes. For
  923. instance F1 brings up HELP, Alt-F4 closes an active program, Ctrl-Esc brings 
  924. up the Task List,Alt-Esc and Tab-Esc switch to the next program in the Task 
  925. List, Alt-F7  moves a Window, Alt-F8 resizes, Alt-F10 maximizes, Alt-F5 
  926. restores and so on. In addition each program as a rule has its own set of 
  927. dedicated Keystrokes to accomplish certain actions. Editors and Word 
  928. Processors are very rich in such keystroke assignments.
  929.  
  930. If a Hot-Key type program is to be useful, it should be as unobtrusive as 
  931. possible and not interfere with programmatic hot-keys. I originally chose 
  932. the triple key combination of Shift-Alt-X, Shift-Ctrl-X, where X can be
  933. 0,....9,A,B,.....Y,Z (case insensitive) for the Hot-Keys since in my 
  934. experience to date, they had been almost unused. I also used those
  935. combinations with X being keys on the Key_Pads for Hard Coded actions 
  936. relating to tasks involving HOOK itself. A configuration option exists that 
  937. allows these hard coded assignments to be active only on the Numeric Key 
  938. Pad. I have recently added the combination Alt-Ctrl-X to the Hot Keys 
  939. increasing the capability by 50 %. And at the request of a user I added
  940. Alt-Pause, and at the same time added Shift-Pause as well. These may be
  941. assigned from either the Hot Key Define Menu or from HOOK.DAT.
  942.  
  943. Now for some CAVEATS.
  944.  
  945. There is at least ONE Program, VIEWALL.EXE of IBMs that does not let
  946. itself be installed in the TaskList. Why I do not know. I asked IBM and
  947. got their usual non-response. Anyhow, HOOK uses the TaskList intensely.
  948. The consequence of this program not using the TaskList is that you
  949. cannot switch to it by a HotKey after it is loaded, even though you can
  950. still load it with a HotKey. If use assign it to a HotKey, use your
  951. mouse to switch to it.
  952.  
  953. >>>> Since this type of program is not in the Task List the techniques
  954. >>>> HOOK uses to turn the Flashing window OFF after a program is loaded
  955. >>>> do not work. Thus, when any HOOK program is loaded, a Timer is
  956. >>>> started that turns off the Flashing Window and resets some other
  957. >>>> crucial parameters of HOOK so that it will continue to function
  958. >>>> normally. This time delay is set at  10 seconds.
  959.  
  960. There are some editors, the E.EXE OS/2 Editor for instance as well as
  961. the Editors built into many Compiler programs that use the
  962. Shift-Ctrl-Cursor_Pad keys very heavily for Block activities and thus I
  963. have added a Toggle key, Shift-Alt-5(On KeyPad) to HOOK that allows the user
  964. to temporarily toggle its trapping actions OFF so that the total
  965. Keyboard is available to the user. That same Toggle key then
  966. re-activates HOOK so that Hot-Key switching is back ON.
  967.  
  968. PM programs also make use of Mnemonic Keys when the Menu bar is active
  969. (menus accessible with Alt-F, Alt-H, etc.). If a PM program uses mnemonic
  970. keys ( Help is an example) and you have H assigned as a HOT-Key, say
  971. Shift-Alt-H, then when you press Shift-Alt-H you will get the Menu Key
  972. Option for H, but pressing it a second time will bring up the Hot-Key 
  973. assignment.
  974.  
  975. In addition PM programs may also use assignments to Ctrl-X (as the E edior 
  976. does for X=F for the Find option). If you have a Hot-Key assigned to 
  977. Shift-Ctrl-X, where X is a program defined key, then the Hot-Key will bring 
  978. up that option. A quick repeat of the Hot-Key will produce its desired 
  979. action.
  980.  
  981. These kinds of problems do not bother non-PM programs (ASCII text editors) 
  982. and similar TEXT based Non-PM programs.
  983.  
  984. I have built into HOOK a configuraton option (changeable while HOOK is in 
  985. use) that can modify the above behavior. HOOK works through HOOKQDLL.DLL 
  986. which intercepts the message queue and looks at each WM_CHAR message. Each 
  987. message has a flag that indicates whether it is a PM type application or not 
  988. and the DLL tests that flag. The configuraiton option allows the DLL to take 
  989. an action depending on whether that flag is set for a given WM_CHAR message.
  990.  
  991. The default option is to ignore the flag. This has the consequence that the 
  992. program entering key strokes and thus using Hot-Keys has the KB focus and 
  993. will activate any PM program user defined keys - as noted this can be 
  994. quickly overridden by entering the Hot-Key again. But one can change that 
  995. behavior with the DLL configuration option so that when a PM program has the 
  996. KB focus, when a Hot-Key sequence is hit, it switches the focus to the 
  997. DeskTop so that the PM program's defined keys are not accessed. Whether this 
  998. is desireable or not depends on the particular PM program, how one uses it 
  999. and so forth. In general I find the default setting of no resetting the 
  1000. focus the most useful, since  re-entering the hot-key if required is not 
  1001. very onerous and you do not lose access to a programs built in keystrokes.
  1002.  
  1003. End of CAVEATS
  1004.  
  1005. There are two classes of hot-key assignments in HOOK. One class is hard
  1006. coded and cannot be changed by the user. 
  1007.  
  1008. The other is under the user's control and allows the user to assign
  1009. specific actions to a given key combination. That assignment may be done
  1010. in one of two ways. The default (new) is by filling in parameters into a
  1011. menu activated by Shift-Alt-F3. An optional method is to fill in a (user
  1012. maintained) ASCII Text file (HOOK.DAT) which HOOK can read in on command 
  1013. activated by Shift-Alt-UpArrow when HOOK is active. This method is that
  1014. user by earlier versions of HOOK prior to 3.01.
  1015.  
  1016. These two methods are not exclusive and both may be used. The HOOK.DAT file 
  1017. is backwardly compatible with earlier versions of HOOK. The Hot Keys assigned
  1018. by filling in the parameters into the Menu are saved in the file named
  1019. HOOK.HKY which is re-read every time HOOK is loaded. Any assignments read in
  1020. from HOOK.DAT are saved in the same structure saved by HOOK.HKY and are thus 
  1021. not lost when HOOK is exited. Current values may be saved by using the
  1022. Alt-Shift-DnArrow to read them to HOOK.HKY
  1023.  
  1024. HOOK has an additional feature. It can (with some limitations) save a
  1025. sequence of Keyboard and Mouse Actions so that they may be replayed. I have 
  1026. found this useful for establishing certain DESKTOP environments that I use 
  1027. repeatedly. These "Macros" may be saved to Disk and restored From disk to 
  1028. memory for replay. When saved to disk, the user is prompted for the name 
  1029. under which to save the macro and two files are saved in X:.\HOOKdir. One 
  1030. with the extension HEX which is the file that can be played back when loaded 
  1031. into memory and the other a Text file with extension MAC. The latter 
  1032. contains the information in the Message queue for the sequence of commands 
  1033. that are in the Macro.
  1034.  
  1035. These macros may also be played back from the command line (or assigned to 
  1036. Hot Keys to play them back) by using PLAYBACK.EXE or PLAYBAKF.EXE for
  1037. general macros, In that case the DLL setting should correspond to the
  1038. Active Window having the KB focus, otherwise your playback does not go
  1039. where you intend it to. PLAYBAKF.EXE is essentially the same as
  1040. PLAYBACK.EXE except that the macro is played back FASTER.
  1041.  
  1042. An alternate option in the Define Menu fir HotKeys allows the user
  1043. to assign sequences of HotKeys (or sequences of ASCII Hcaracters) to
  1044. a Hot Key and play them back. This replaces some use of Macro Recoridng
  1045. and Playing them back if what is being recorded is Just Text entry
  1046. or ASCII characterss to paste onto the screen. See later for more details.
  1047.  
  1048. HOOK communicates with the user via a small window on the desktop. I have 
  1049. found it useful to have this window contain the current date and time as 
  1050. well as to display messages from the program. The window appears as:
  1051.  
  1052.                   ┌──┬─────────┬──┐
  1053.                   │ ╨│ KB HOOK │ ▄│
  1054.                   ├──┴─────────┴──┤
  1055.                   │ KB¿  hh:mm:ss │
  1056.                   │ Day  mm-dd-yy │
  1057.                   └───────────────┘
  1058.  
  1059. The time is updated every second and the updates are maintained via a 
  1060. separate thread started from HOOK .
  1061.  
  1062. There is an option in the On Line configuration to make the Window Invisible 
  1063. as well as options to change its size, location and colors (if Visible).The 
  1064. default location is the lower right corner.
  1065.  
  1066. Messages are displayed on the first line of the display temporarily
  1067. overwriting the current time.
  1068.  
  1069. When HOOK is carrying out some special activity it will display a message
  1070. in the Window reflecting that on the first line of the widow.
  1071.  
  1072. When a Program is being switched to it will display a message indicating
  1073. the method HOOK used to do that; either the Switch List Handle
  1074. (TL-Handle) or the Switch List Title (TL-Title).
  1075.  
  1076. When a Program is being loaded it will display the message  Prog_Load in
  1077. the HOOK window. It will also Flash that window and sound a few initial
  1078. beeps. During that time No Other pprogram should be loaded. When
  1079. the window stops flashing it safe to load another program. The delay
  1080. depends on the type of program being loaded. Hardly any at all for non-PM
  1081. program but can take longer for som ePM programs.
  1082.  
  1083. INSTALLING THE HOOK
  1084.  
  1085. To use the Install.exe program, be sure it is in the same directory as the 
  1086. rest of the files included in the ZIP file. If you are installing from a 
  1087. floppy, make the floppy drive the active directory and be sure that OS/2 is 
  1088. active. You should do this from an OS/2 window.
  1089.  
  1090. IF a PREVIOUS VERSION IS ACTIVE, UNLOAD it before installing this version.
  1091.  
  1092. INSTALL.EXE installs this version in a directory named \HOOKdir on a
  1093. drive (X:) both modifiable by the user in a Menu Entry Field. The
  1094. Install program allows a directory path name (including the drive
  1095. specification) up to a total of 60 characters in length and the
  1096. specification may include sub- directories so long as the length limit
  1097. is obeyed.
  1098.  
  1099. To use INSTALL just enter INSTALL from the command line where the current 
  1100. directory contains INSTALL,EXE and the other unzipped files.
  1101.  
  1102. The files will be copied to the appropriate directory and if it does not
  1103. exist it will be created.
  1104.  
  1105. What INSTALL.EXE does in detail:
  1106.  
  1107. A menu is presented with an input field of
  1108.  
  1109.   C:\hook
  1110.  
  1111. prompting the user to accept the parameters as given or to edit them to meet
  1112. his/her requirements. A directory specificaton, including  sub directories,
  1113. up to 60 characters long may be entered. If the director(ies) do not
  1114. exist they will be created.
  1115.  
  1116. IF X:\HOOK\ (or the drive:\name chosen) does not exist, it will be created.
  1117.  
  1118. If HOOK.DAT exists in X:\HOOKdir\ it will be renamed to HOOK.DAX. IF
  1119. HOOK.HKY exists in X:\HOOKdir\ it will be renamed to HOOK.HKX.
  1120.  
  1121. HOOK.DAT, HOOK.EXE, HOOK.HKY, HOOK.INF, HOOK.INI, HOOK.TXT, DOSERDLL.Dll,
  1122. HOOKQDLL.DLL and README.1ST will be copied to X:\HOOKdir\.
  1123.  
  1124.          !!!  FOR USERS OF VERSIONS PREVIOUS TO 3.01  !!!
  1125.  
  1126. You should delete any current version of HOOKQDLL.DLL before beginning the
  1127. installation of this version.
  1128.  
  1129. This new version is backward compatible with HOOK.DAT BUT its primary,
  1130. and the DEFAULT method of entering HOT Key Assignments is by the use of
  1131. an ON SCREEN menu system, activated by Alt-Shift-F3. If you prefer to
  1132. use the former method of assigning Hot Keys (i.e. via HOOK.DAT) its
  1133. assignments must now be manually read in after HOOK is loaded by using
  1134. the Hot-Key Shift-Ctl-UpArrow (changed from  prevous versions) or making
  1135. a selection from the Menu (activated by Alt-Shift-F2).
  1136.  
  1137. After completing the installation you may substitute your current
  1138. HOOK???.DAT file by copying it to X:\HOOKdir and renaming it as HOOK.DAT. 
  1139. BUT before doing that look at the header to the default DAT file which 
  1140. comments its structure for calling programs. Current DAT files can be used 
  1141. but there are enhancements that you may find useful. It would probably be 
  1142. wiser to just edit HOOK.DAT to reflect your current usage.
  1143.  
  1144. STARTING HOOK
  1145.  
  1146. Assume that HOOK is installed on drive X:  in the directory HOOKdir.
  1147. To start the program, from an OS/2   command line give the command
  1148.  
  1149.     X:\HOOKDir\HOOK   or Start X:\HOOKDir\hook
  1150.  
  1151. You could have this command in a CMD file as a means of starting
  1152. HOOK or you could also have it in your STARTUP file.
  1153.  
  1154. One of the new features is the ability to pass HOOK a parameter on
  1155. the command line which specifies a HotKey to activate after HOOK
  1156. is started. This is detailed later.
  1157.  
  1158. CONFIGURING THE HOOK
  1159.  
  1160. There are various configuration parameters for the program which are stored 
  1161. in the file HOOK.INI which is read in by the program when it is started and 
  1162. which remain in effect unless changed from the configuration menu. In 
  1163. addition HOOK.HKY which has the User Defined Hot-Key Assignments is also 
  1164. read in when the program is started .
  1165.  
  1166. User Assignments may be modified when the program is active as may the other 
  1167. configuration options. 
  1168.  
  1169. Hot-Key Assignments are modified by using Shift-Alt-F3 to access the Hot-Keys 
  1170. Menu Screen to add new assignments, delete current assignments or edit(new)
  1171. current assignments. Hot-Key Assignments may also be modified by altering 
  1172. HOOK.DAT and then re-reading it into memory using Shift-Ctl-UpArrow.
  1173.  
  1174. The program window may be resized and relocated by using the Mouse
  1175. Pointer at the window edges to change window dimensions, thus
  1176. effectively resizing and relocating the window. Alternately the use may
  1177. use the Move and Size options of the HOOK Window to make those chantges.
  1178.  
  1179. In either case, the ability to save those changes for the next startup
  1180. are among the configuration options for the program.
  1181.  
  1182. These options for the program are available by placing the mouse pointer
  1183. anywhere on the display window and pressing the right mouse button or by
  1184. pressing the key combination Shift-Ctrl-5 or Shift-Alt-F2.  Either
  1185. brings up the menu displayed below:
  1186.  
  1187.                          HOOK Version 5.60
  1188.    Quit KeyBoard Hook
  1189.    Select Editor to use for DAT File Edit
  1190.    Edit HOOK.DAT File (Updates HOOK when Edit HOOK.DAT exited)
  1191.      (To UPDATE while Editing : Save File then Shift-Ctl-UpArrow )
  1192.    Assign Hot Keys
  1193.    Read In HOOK.DAT assignments for Hot Keys
  1194.    Save Current Hot Key Assignments to HOOK.HKY
  1195.    Get HOOK.HKY Assignments for Hot Keys
  1196.    CoPy Active PM Task List Titles to Hot-Key Descriptions
  1197.    Change Colors
  1198.    Window Options
  1199.    Message Display and KeyPad Use Options
  1200.    DLL Option Set Window Focus for PM Programs
  1201.    DLL Option PASS/DONT_PASS HotKey Messages ON in Message Queue
  1202.    Display Scheduled Hot Keys
  1203.    Use Ctl-Alt-Del Option
  1204.  
  1205.    Explanations:
  1206.  
  1207.    Quit KeyBoard Hook
  1208.         Closes the program in an orderly fashion.
  1209.  
  1210.    Select Editor to use for DAT File Edit
  1211.         Allows user to enter the filespec of the editor to use for
  1212.         editing the DAT file or to change the filespec of the default
  1213.         editor (E.EXE) if it is not in X:\os2\. The editor
  1214.         selected is saved in HOOK.INI.
  1215.  
  1216.    Edit HOOK DAT File
  1217.         By default uses the E.EXE editor of OS/2. It is assumed that editor
  1218.         is located in C:\os2. The filesper may be changed using
  1219.         the option listed above.
  1220.  
  1221.    (Updating the EXE file occurs when the Editor Above is Closed)
  1222.         The DAT file is automatically re-read into the EXE file and
  1223.         the appropriate buffers updated when the Editor used to modify
  1224.         the DAT file is closed. If one does not use this option to
  1225.         modify the DAT file, then the EXE may also be dynamically
  1226.         updated with the Key combination Shift-Alt-UpArrow.
  1227.  
  1228.    Assign Hot Keys
  1229.         Activates the Define Hot-Keys Menu (same as Shift-Alt-F3)
  1230.  
  1231.    Read In HOOK.DAT assignments for Hot Keys
  1232.         Same as using Shift-Ctl-UpArrow to read in current HOOK.DAT File
  1233.  
  1234.    Save Current Hot Key Assignments to HOOK.HKY
  1235.            Saves all Current Hot-Key Assignments to disk in HOOK.HKY
  1236.  
  1237.    Get HOOK.HKY Assignments for Hot Keys
  1238.         Reads in HOOK.HKY from Disk. This will override all current assignments
  1239.         in place. This is same as Shift-Alt-UpArrow.
  1240.  
  1241.    CoPy Active PM Task List Titles to Hot-Key Descriptions
  1242.         Many PM programs modify the Task List Title established by HOOK when
  1243.         the program is loaded. HOOK uses the Task List title to switch to
  1244.         loaded programs. Using this option will copy the Task List title
  1245.         established by a PM program to the Description for that program
  1246.         maintained by HOOK. This enables HOOK to switch to that program if
  1247.         other methods fail.
  1248.  
  1249.    Change Colors
  1250.         Presents the user with a menu allowing the selection of Foreground
  1251.         and Background Colors from a group of 16 options Using Push Buttons.
  1252.         The changes are effected immediately and are saved in HOOK.INI.
  1253.  
  1254.         ■F WHITE  ■B       ■F DARKGRAY  ■B
  1255.         ■F BLACK  ■B       ■F DARKBLUE  ■B
  1256.         ■F BLUE   ■B       ■F DARKRED   ■B
  1257.         ■F RED    ■B       ■F DARKPINK  ■B
  1258.         ■F PINK   ■B       ■F DARKGREEN ■B
  1259.         ■F GREEN  ■B       ■F DARKCYAN  ■B
  1260.         ■F CYAN   ■B       ■F BROWN     ■B
  1261.         ■F YELLOW ■B       ■F PALEGRAY  ■B
  1262.  
  1263.         Default Foreground = Blue   Default Background = White
  1264.  
  1265.         In the Menu the Actual Colors are displayed instead of the Text
  1266.         indicating the colors.
  1267.  
  1268.  
  1269.    Window Options
  1270.    Selecting the Window Options presents 8 push buttons in 3 separate
  1271.    group indicated below.
  1272.  
  1273.                 Select Window Options        ----- Comment -----
  1274.  
  1275.      o Window Bottom Left
  1276.      o Window Bottom Center
  1277.      o Window Bottom Right                       Default
  1278.      o Use Current Win Size/Position
  1279.  
  1280.      o Window Visibile                           Default
  1281.      o Window Not Visible
  1282.  
  1283.      o Window NotJumpable                        Default
  1284.      o Window Jumpable
  1285.  
  1286.     The choices grouped together in each of the 3 groups are
  1287.     mutually exclusive and only one may be chosen.
  1288.  
  1289.     The first group of 4 offers selection for the placement of the
  1290.     HOOK information window
  1291.  
  1292.                   ┌──┬─────────┬──┐
  1293.                   │ ╨│ KB HOOK │ ▄│
  1294.                   ├──┴─────────┴──┤
  1295.                   │ KB¿  hh:mm:ss │
  1296.                   │ Day  mm-dd-yy │
  1297.                   └───────────────┘
  1298.  
  1299.     The first  three place the window at the bottom of the screen
  1300.     at one of the three locations indicated.
  1301.  
  1302.     The fourth choice is meant to be used if none of the first three
  1303.     are acceptable. The user may reposition and resize the window by
  1304.     using the pointer to drag the sides to new locations and to  resize
  1305.     the window accordingly. Or one may use the Move/Size options of
  1306.     the HOOK window's menu to do the same. Hook may also be repositioned
  1307.     by putting making HOOK the active window and with the pointer in its
  1308.     window drage to the desired location.
  1309.  
  1310.     In either case, after it is positioned to your liking that selection
  1311.     will copy the data for the new window position to HOOK.INI and it
  1312.     will be used on starting up again.
  1313.  
  1314.     The second group of two is the option for the Visibility of the
  1315.     window. If Invisible is chosen, it is temporarily made visible
  1316.     to display any messages in the window.
  1317.  
  1318.     The last group sets the response to the Alt-Esc / Alt-TAb Key stroke
  1319.     actions. Not Jumpable means the window is not made active in
  1320.     response to those key strokes.
  1321.  
  1322.   Message Display and KeyPad Use Options
  1323.     When a program is loaded  HOOK;s window will Flash and Optionally
  1324.     Beep several times. The default to Beep is ON. An option is
  1325.     give to set this to either ON or OFF.
  1326.  
  1327.     Hook may be unloaded (Shift-Alt-Del) or unloaded and OS/2 Closed
  1328.     down (Shift-Alt-End). The DEFAULT is to display a Message Box for
  1329.     either case asking if you want to continue. This may be changed
  1330.     to no Message Box display with this option.
  1331.  
  1332.     Some computers have 2 Sets of Key Pads . One has numeric keys and is
  1333.     referred to as the W(hite) pad and the other  has cursor keys and is
  1334.     referred to as the G(rey) Pad. The DEFAULT configuration is to have
  1335.     both key pads respond to the Built In Hot-Key Assignments which use
  1336.     the Key Pad in conjunction with the Shift-Alt/Ctrl keys. That may be
  1337.     changed to use only the Numeric Key pad with this option.
  1338.  
  1339.   BEEP sounded when HOOK loaded.
  1340.     Some users have requested this option to turn Off/On the BEEP
  1341.     signal when HOOK is loaded.
  1342.  
  1343.   DLL Option Set Window Focus for PM Programs
  1344.     The DEFAULT configuration does not change the KB Focus of the
  1345.     program entering Hot-Keys. This means that if a PM program has
  1346.     defined Alt-X or Ctrl-X combinations and you enter a Hot-Key
  1347.     combination that has Alt-X or Ctrl-X in it, it will activate that
  1348.     built in option; repeating the Hot-Key will then activate its
  1349.     desired action, closing the program defined action. Retaining this
  1350.     setting also means that Keyboard Macros will be entered into the
  1351.     current window as it has the KB focus.
  1352.  
  1353.     The other option changes the KB focus from the window that had the
  1354.     focus to the DeskTop. This means that no  repeat Hot-Keys need
  1355.     be entered, but also playback of KB macros does not work, nor does
  1356.     the user have access to the programs defined option keys.
  1357.  
  1358.     In general the DEFAULT option of Window retaining the KB focus is
  1359.     the most useful and flexible.
  1360.  
  1361.   DLL Option PASS/DONT_PASS HotKey Messages ON in Message Queue
  1362.     The default setting is for HOOKQDLL not to pass the WM_CHAR messages
  1363.     that contain the KeyStroke Combinations Shift-Alt-X  Shift-Ctrl-X
  1364.     ALt-Ctrl-X  Alt-Pause  Ctrl-Pause where X is a valid Keyboard Scan
  1365.     Code, to the next Message Queue. This is because when a Shift-Alt-X
  1366.     for example, is activated, there is also activated an Alt-X and many
  1367.     programs have built in Hot-Keys sensitive to such assignments. If
  1368.     the message were not discarded, every time you used a Hot Key
  1369.     containing such a combination that the Program with the Keyboard
  1370.     Focus (Active Program) used, you would activate that also and it is
  1371.     a most uncomfortable environment to work in. It is recommended
  1372.     that if this gives a problem for some programs, then just temporarily
  1373.     deactivate HOOK with the Off/On toggle initiated by Shift-Ctl-SpaceBar.
  1374.  
  1375.    Display Scheduled Hot Keys
  1376.      This option will display a Screen listing ALL the Hot Keys which have
  1377.      been scheduled in the format (X means not scheduled that day and
  1378.      hh:mm aare the hour and minutes after the hour as Scheduled) :
  1379.                                        ------------- Comment -------------
  1380.    * Alt-X  hh:mm AM on S M T W T F S  S-A-X scheduled AM on All days of week
  1381.    * Ctl-X  hh:mm PM on X M X W T F X  S-C-X scheduled PM on Mon,Wed,Thu,Fri
  1382.    * Qac-X  hh:mm PM on X X X W X F X  A-C-X scheduled PM on Wed,Fri
  1383.      Pse-A  hh:mm AM on X X X X X F X  Alt-Pause  scheduled AM on,Fri
  1384.      Pse-S  hh:mm PM on S X X X X X S  Shft-Pause scheduled PM on Sun,Sat
  1385.  
  1386.    * X : 0,1,.....9,A,B,......Z
  1387.  
  1388.    The display option allows for the display of 44 Scheduled Hot Keys.
  1389.  
  1390.   Use Ctl-Alt-Del Option
  1391.     This option deals with the Alternate REBOOT Option. The default
  1392.     value is to USE the Alternate REBOOT Option. That is, the
  1393.     Ctl-Alt-Esc key REBOOTS the system. When this option is ON, the
  1394.     Ctl-Alt-Del key sequence is disabled. This menu option will offer
  1395.     the User the option to Turn OFF the implementation IF it is ON and
  1396.     to turn it ON if the implementation is OFF.
  1397.  
  1398.     Changes made from this Menu remain in effect thru the remainder of
  1399.     the session while HOOK is active. When the session is ended, via
  1400.     Shift-Alt-End or Shift-Alt-Del the current values of these parameters
  1401.     are saved in HOOK.INI and these are restored for use when the program
  1402.     is next loaded.
  1403.  
  1404.  
  1405. SELECTING THE EDITOR FOR EDITING THE DAT FILE
  1406.  
  1407. As noted the default editor used for editing the DAT file is the E.EXE
  1408. editor that is included with OS/2. The assumption is made that this is
  1409. located in C:\os2 where it is placed when installing OS/2 2.0 / 2.1 or
  1410. WARP. If this editor is not satisfactory or the assumption is incorrect
  1411. then use this option to enter the correct drive and directory for e.exe
  1412. or the editor of your choice.
  1413.  
  1414. REBOOT Option
  1415.  
  1416. HOOK uses the DosDevIOCTL Keyboard category, function 56H to toggle the
  1417. Alt-Ctrl-Del key combination OFF/On. The first time it is called it is
  1418. toggled OFF, the next time ON,etc. I have found that I sometimes
  1419. inadvertently hit the Alt-Ctrl-Del sequence and have no way to recover.
  1420. HOOK  toggles Alt-Ctrl-Del OFF when it is loaded and ON when it is
  1421. Unloaded (Shift-Alt-Del).
  1422.  
  1423. In this version the Alt-Ctl-Esc key is a built-in Hot Key that displays
  1424. a message "Do You Really Want to REBOOT ?"and gives you a Yes - No
  1425. choice. IF you choose YES, then Alt-Ctl-Del is Toggled ON and HOOK is
  1426. exited without saving any HOOK files (in the spirit of REBOOTING).
  1427.  
  1428. I have found that I sometimes inadvertently hit Alt-Ctl-Del when I meant
  1429. to hit Alt-Shift-Del and so I installed this SAFEGUARD.
  1430.  
  1431. NB. Toggling OFF the Ctl-Alt-Del sequence has a side effect. The
  1432.     Alt-Home key combination, which in a DOS session allows switching
  1433.     between a window and Full Screen, is DISABLED.
  1434.  
  1435. HOT-KEY ASSIGNMENTS-FIXED BY PROGRAM
  1436.  
  1437. The fixed key assignments are all related to the functioning of HOOK and
  1438. with one exception use the Shift-Alt or Shift-Ctrl keys in combination
  1439. with the Numeric or cursor pad (default option).
  1440.  
  1441. HARD CODED ASSIGNMENTS     Explanations
  1442.  
  1443. Shft-Alt-?              Display User Defined HotKeys for Shift-Alt-X **
  1444. Shft-Ctl-?              Display User Defined HotKeys for Shift-Ctl-X **
  1445. Alt-Ctl-?               Alt-(Ctl-X) / Pause Hot Key Assignments  **
  1446. Shft-Alt-\              Display Prog Defined HotKeys (this listing)
  1447.  
  1448. Shft-Ctl-Esc            REBOOT Option
  1449. Shft-Alt-Del            Unload HOOK
  1450. Shft-Alt-End            Unload HOOK and ShutDown System
  1451. Shft-Ctl-Del            Close Progs Started by HOOK
  1452. Alt-Ctl-End             Close Active Program
  1453. Alt-Ctl-Up/DnArrow      DeActivate One/All HotKeys  !
  1454.  
  1455. Shft-Alt-UpArrow        Read HOOK.HKY into Memory
  1456. Shft-Alt-DnArrow        Save Current Hot Keys to HOOK.HKY
  1457. Shft-Ctl-UpArrow        Read HOOK.DAT into Memory
  1458. Shft-Alt-Ins            Open Small OS/2 Window
  1459.  
  1460. Shft-Ctl-LeftArrow/[    Start Macro Recording
  1461. Shft-Ctl-RghtArrow/]    End Macro Recording and Save to Disk File
  1462. Shft-Ctl-Ins            PlayBack Macro Currently in Memory
  1463. Shft-Ctl-PgDn           Save Current Loaded Macro to DiskFile
  1464. Shft-Ctl-PgUp           Load Selected Macro from Disk to Memory
  1465.  
  1466. Shft-Alt-F1             Activate On LIne Reference Window
  1467. Shft-ALt-F2|Ctl-5       Activate PopUpMenu for Configuration Options
  1468. Shft-Alt-F3             Activate Hot Key Assignment Menu
  1469. Shft-Alt-F5             Select File to Paste to PM Program
  1470. Shft-Alt-F9             Assign Hot Key to Active Window
  1471.  
  1472. Shft-Ctl-SpaceBar       Toggle Hot-Keys Off/On
  1473. Shft-Alt-SpaceBar       Toggle PASTE Mode Off/On
  1474.  
  1475. Right Mouse Button(On HOOK Window)  PopUpMenu for Configuration Options
  1476.  
  1477.                      Press <Esc> or <CR> to Exit
  1478.  
  1479. * These options exist for use when recording macros in the E and EPM
  1480.   editors and similar ones which use Shift-Left|Right Cursor to Start
  1481.   and End copy and paste operations of text.
  1482.  
  1483. **This display reflects the current Active Hot-Key assignments. If
  1484.   HOOK.DAT is read in with new assignments or new assignments are made
  1485.   from the Hot-Key Menu those are automatically reflected in this
  1486.   listing. No user intervention is required for these file displays
  1487.   (this is  changed from earlier versions which required the user to
  1488.   create these displays)
  1489.  
  1490. ! Deactivation means that the TaskList Handle (used for switching by
  1491.   HOtKeys) stored for a HotKey is set to NULL so that if this HotKey is
  1492.   Entered, a new seesion for the program assigned to that HotKey is
  1493.   started. This is useful if by inadvertance HOOK is closed. When HOOK
  1494.   is closed any other means than Shift-Alt-Del the current
  1495.   TaskListHandles are not saved so that when HOOK is restarted  Programs
  1496.   loaded by HOOK do not have HotKeys actively assigned. This is a means
  1497.   of setting the Slate Clean (as it were) and one should closed those
  1498.   windows and reopen to have the full benefits of the HotKeys.
  1499.  
  1500.   It is also useful if you want to start a new session for a given Program.
  1501.   The HotKey will then be active for the new Session.
  1502.  
  1503.              Extended KeyStroke Insertion into PM Applications
  1504.  
  1505. There are two ways of accessing this:
  1506.  
  1507.   1-Assign to a HotKey using the HotKey menu.
  1508.     Enter the Coded Text into the Prgm. File Spec field with the
  1509.     first character entered the colon (&colon.). This is a signature
  1510.     required by HOOK. This does not supplant or replace the HotKey
  1511.     assignments preceeded by a '&colon.' or a '-'. Those and their formats
  1512.     are still valid.
  1513.  
  1514.     No other fields are required though the Description Field may be
  1515.     used.
  1516.  
  1517.   2-Create an ASCII Text File (default is extension of TXT) containing
  1518.     the coded text and access the file via the BuiltInHotKey
  1519.     Shift-Alt-F5.
  1520.  
  1521.     The Target Window (a PM application) must be Active when Shift-Alt-F5
  1522.     is executed. The user will be presented with a file dialog whose
  1523.     default is \Hookdir\*.txt  on the drive where HOOK was installed and
  1524.     Hookdir is the name of the directory chosen for installation.
  1525.     Select the desired file and the content will be pasted into the
  1526.     Target Window.
  1527.  
  1528.     AT the conclusion a sound will be made and a message displayed
  1529.     saying that the File (and the file spec will be displayed) has
  1530.     completed processing.
  1531.  
  1532.     The next time Shift-Alt-F5 is called the default directory and file
  1533.     extension will be that of the file last selected.
  1534.  
  1535. Keys will be coded as the appear on the keyboard with exceptions as noted.
  1536. The Key Coding is NOT CASE SENSITIVE
  1537.  
  1538. To display < enter as <<
  1539. To display > enter as >>
  1540.  
  1541. ------ Actions Not Related to Keys
  1542. <Wait ###.###> inserts a delay of up to ###.### seconds
  1543.             <Wait #>   =  #     secs
  1544.             <Wait #.#> =  #.#   secs
  1545.             <Wait##.##> = ##.## secs
  1546.                 etc.
  1547.          spaces are ignored.
  1548.  
  1549. ----- Comments (not pasted) are included as:
  1550. <* any comment>
  1551.  
  1552. ------Sound a Tone of frequency f for a duration of d milliseconds
  1553. <! f,d>
  1554.      300 cycles/sec for 1/2 second(500 Milliseconds) is  <! 300,500>
  1555.  
  1556. -----  Single Keys  -----       <------------- Comment ------------->
  1557. X&colon.0..9,a..z,A,.Z,rest of Printable Ascii
  1558. <Esc>     Escape Key              Response Depemds on Target Window
  1559. <Tab>     Tab Key
  1560. <Bksp>    BackSpace Key
  1561. <Alt>     Alternate Key           Response Depemds on Target Window
  1562. <Ctrl>    Control Key             Response Depemds on Target Window
  1563. <Shift>   ShiftKey                Response Depemds on Target Window
  1564. <Enter>   Enter Key
  1565. <Space>   Space Bar
  1566. <FX>      Function Key X&colon.0---12   Response Depemds on Target Window
  1567.  
  1568. ----- Cursor Pad Keys ----
  1569. <Home>    Home Key
  1570. <End>     End  Key
  1571. <PgUp>    PgUp Key
  1572. <PgDn>    PgDn Key
  1573. <Up>      Up    Arrow Key
  1574. <Dn>      Down  Arrow Key
  1575. <Left>    Left  Arrow Key
  1576. <Right>   Right Arrow Key
  1577. <Ins>     Insert Key
  1578. <Del>     Delete Key
  1579.  
  1580. ------ Other Keys ---------
  1581. <PrtScr>  PrintScreen Key
  1582. <Pause>   Pause
  1583. <Pause> is essentially meaningless   here - if followed by KeyInput then that
  1584.         is overridden at once.
  1585.  
  1586. NB For TextFiles the embedded CarriageReturn LineFeed at the end of each
  1587.    line of text is ignored. To actually create that combination in pasting
  1588.    you must have the coding <Enter> .
  1589.  
  1590.    Example&colon. This is a text file to paste
  1591. <! 100,300>745407745472<Tab>wait 1  <Wait 1>01<Enter>
  1592. <* A Comment>938498458277<Tab>wait 2  <Wait 2>02<Enter>
  1593. 03928<*Another Comment>3978475<Tab>wait 3  <Wait 3>03<Enter>
  1594. <! 1000,200>745297392772<Tab>wait 4  <Wait 4>04<Enter>
  1595.  
  1596.    When pasted into a PM Editor such as the E.EXE or EPM.EXE editor it
  1597.    appears as&colon.
  1598.  
  1599. 745407745472    wait 1  01
  1600. 938498458277    wait 2  02
  1601. 039283978475    wait 3  03
  1602. 745297392772    wait 4  04
  1603.  
  1604. and the appropriate sounds would have been made at the start of lines 1
  1605. and 4 and the time delays would have occured at the locations where coded.
  1606.  
  1607. An example of using a HotKey is as follows on Prgm File Spec
  1608.  
  1609. &colon.if( )<Enter>{<Enter><Enter>}<Up><Up><Up><Right><Right>
  1610.  
  1611. When that HotKey assignment is executed into a PM Editor and the
  1612. cursor is at the left margin, it displays
  1613.  
  1614. if( )
  1615. {
  1616.  
  1617. }
  1618.  
  1619. with the cursor appearing inside the ().
  1620.  
  1621. If the cursor is not initially at the left margin, it wil appear as
  1622.  
  1623.      if( )
  1624. {
  1625.  
  1626. }
  1627.  
  1628. where the if( ) is positioned at the cursor location at the time of the call.
  1629.  
  1630. I have found the pasting from a file useful for entering data into
  1631. Spread Sheets or inserting canned text into editors/word processors.
  1632.  
  1633. It is a program indepedent form of Macro for Text.
  1634.  
  1635. HOT-KEY ASSIGNMENTS-USER DEFINED
  1636.  
  1637. There are two methods that may be used to assign Hot-Keys. The first
  1638. employs an On Screen Menu titled
  1639.  
  1640.                          Define Hot-Keys
  1641.  
  1642. This menu is activated by the Hot-Key Alt-Shift-F3 or by selecting the 
  1643. Assign Hot Keys choice from the User Menum Activated by Shift-Alt-F2.
  1644. When either of these choices is made you are presented with the Screen
  1645.  
  1646.          Type in HotKey Combination for Assignment or Editing
  1647.  
  1648.          Shift-Alt-X  Shift-Ctl-X  Alt-Ctl-X  Alt|Shift-Pause
  1649.  
  1650.               Where X = A,B..Z 0,1..9  OR  <Esc> to Abort
  1651.  
  1652. When the Hot Key Menu Appears the HotKey selected will be displayed at
  1653. the top of the Define Hot Keys Menu (below it is indicated as
  1654. Shift-Alt(ScrlLock)-X) if you are in Normal Mode or if in PASTE Mode the
  1655.  
  1656.                 HotKeys Assignment Menu PASTE Mode
  1657.  
  1658. will appear for your input.
  1659.  
  1660. The other method(for normal Hot-Keys only) is backward compatible with
  1661. that used in earlier versions of HOOK. It involves filling in an entry
  1662. in the text File HOOK.DAT that defines the Hot Key Assignment. This file
  1663. is read into HOOK by using the Hot-Key - Shift-Alt-UpArrow (in earlier
  1664. versions this was automatically read into HOOK when it was loaded).
  1665.  
  1666. The Hot-Key assignments that are in place when HOOK is exited are 
  1667. automatically saved in the file HOOK.HKY and these are automatically read 
  1668. into HOOK when it is loaded. (There are options in the menu activated by 
  1669. Alt-Shift-F2 to save the current Hot-Keys to HOOK.HKY and to re-read 
  1670. HOOK.HKY into memory.)
  1671.  
  1672. The active Hot-Key assignments are in a Record Format in HOOK.EXE, where 
  1673. there is a separate record for each of the possible Hot-Key Assignments. When 
  1674. HOOK.DAT is read into HOOK it fills out only those records for which a 
  1675. Hot-Key is assigned in HOOK.DAT. If an assignment exists it is over written.
  1676.  
  1677. If HOOK.HKY is read into memory it completely overwrites the current records
  1678. so that they are lost. If you want to maintain different sets of Hot-Key
  1679. assignments then a given set should be Read Out to HOOK.HKY and that saved by
  1680. renaming it. To read it back it would then have to be renamed back to
  1681. HOOK.HKY. Alterately you could save different sets in a series of HOOK.DAT
  1682. files (stored in a different directory) and copy the one you want to be 
  1683. active to the directory where HOOK.EXE is stored.
  1684.  
  1685.                    THE DEFINE HOT-KEYS MENU SCREEN
  1686.  
  1687.                Assigning Hot Key : Shift-Alt(ScrlLock)-X
  1688.  
  1689.  Prgm. File Spec:  [                                          ] CR Accepts
  1690.  Enter String to Paste as   -|=xxxxxxxxx  and SAVE NB the '-|=' is REQUIRED
  1691.  For <..> formatted Strings :xx<..>xxx    and SAVE NB the  ':'  is REQUIRED
  1692.  
  1693.  o Shell Establishes      o Full Screen OS/2        o Windowable(Vio)
  1694.  o Windowed  (PM)         o Full Screen DOS         o Windowed DOS
  1695.  
  1696.                 !! The Four Items Below are Optional !!
  1697.       Command Line:[                          ] CR Accepts
  1698.  Working directory:[                          ]    CR Accepts
  1699.        Description:[                          ]    CR Accepts
  1700.    Window Loc/Size:[                 ] As: xxx yyy wwww hhhh  ] CR Accepts
  1701.       (in Pels)
  1702.  
  1703.    [( SAVE Hot Key Assignment )]                [(SCHEDULE Hot Key Assignment)]
  1704.  
  1705.    [(CLEAR Selected Hot Key and EXIT)]          [(CLEAR All Hot Keys and EXIT)]
  1706.  
  1707.       Cursor UP/Dn/Left/Right Keys Moves Within Groups
  1708.               SpaceBar or Left Mouse Button to Select
  1709.                Tab Key to Next Group  <Esc> Aborts
  1710.                             [(EXIT)]                            {√} SCHEDULED
  1711.  
  1712. The user Fills in the Hot Key Menu to assign a program to a Hot Key.
  1713.  
  1714. The user MUST : Enter the program specification (just as in the Path Field in
  1715.                 the OS/2 Settings Menu
  1716.  
  1717.                 Select ONE of the Session Types (letting the Shell
  1718.                 establish the type is a good safe choice).
  1719.  
  1720.       >>>>      The validity of the Program Specification is checked and it
  1721.       >>>>      must be a full file specification including drive and full
  1722.       >>>>      path and the file extension of the executable file.
  1723.       >>>>      For OS/2  this is EXE or COM (in some cases); CMD files
  1724.       >>>>      passed on the command line as parameters to the
  1725.       >>>>      Command Processor as the Program (fully specified)
  1726.       >>>>      For DOS it is EXE or COM or BAT.
  1727.  
  1728.   >>  OR  << :  Enter a Text String prefaced by either a '-'or an
  1729.                 '=' that is to be inserted into the active window by the
  1730.                 HotKey and then SAVE. The '-|=' is a REQUIRED
  1731.                 identifier that this is a TEXT STRING and NOT a PROGRAM
  1732.                 NAME. The TextString may contain spaces. No additional
  1733.                 items are required for this option. This option does not
  1734.                 work in a DOS Window. The distinction between using '-'
  1735.                 or '=' is that the latter slows down the insertion of
  1736.                 the string into the target window by inserting a very
  1737.                 small time delay between each character. The reason for
  1738.                 this is that some Queues are small in size and if you
  1739.                 are inserting a long string very rapidly (as using the
  1740.                 '-' option does) the entire string may not usually be
  1741.                 displayed.
  1742.  
  1743.                 The text string may also contain a sequence of HotKeys to
  1744.                 execute. Hot Keys are identified as:
  1745.                  \A|aX        for the HotKey      Shft-Alt-X
  1746.                  \C|cX        for the HotKey      Shft-Ctl-X
  1747.                  \Q|qX        for the HotKey       Alt-Ctl-X
  1748.  
  1749.                 There are two additional options that are useful with the
  1750.                 HotKeys. Each of these may be used up to 20 times in a
  1751.                 given string assignment.
  1752.  
  1753.                 The time delays inserted below in both cases are from the
  1754.                 beginning of the invocation of the sequence.
  1755.  
  1756.                 The sequence \rxxx where xxx is any integer creates a
  1757.                 time delay of xxx seconds and then executes a Carriage
  1758.                 Return into the window having the KB focus at that time.
  1759.  
  1760.                 The sequence \dxxx followed by a HotKey designation
  1761.                 (no spaces between \dxxx and the HotKey spec) executes
  1762.                 that HotKey after a time dealy of xxx seconds from the
  1763.                 initiation of the sequence.
  1764.  
  1765.                 These are useful for sequences that may reauire a Carriage
  1766.                 Return after loading an initial program (such as an Internet
  1767.                 Access Programs) and then want to load another program
  1768.                 that requires the first be active (such as an E Mail program).
  1769.                 Since the first program may take many seconds to complete
  1770.                 the time dealy before the execution of the second allows
  1771.                 this to happen. For each of these a series of beeps is
  1772.                 sounded when the time delay is met.
  1773.  
  1774.                 The use of the Time Delay in the sequence is a means of
  1775.                 serializing the sequence of events. The Window Flash is
  1776.                 turned off for those HotKeys Activated using this format.
  1777.  
  1778.                 The user may if desired enter a description for the text
  1779.                 strings. Any other fields are ignored when the - option
  1780.                 for the Program File Spec is chosen.
  1781.  
  1782.  NEW FEATURE    The <...> coding format for Pasting TEXT into PM Programs.
  1783.                 To USE this  prefix the formatted string with  ':'  .
  1784.  
  1785.                 Keys will be coded as the appear on the keyboard with
  1786.                 exceptions as noted. The Key Coding is NOT CASE
  1787.                 SENSITIVE
  1788.  
  1789.                 To display < enter as <<
  1790.                 To display > enter as >>
  1791.  
  1792.                 ------ Actions Not Related to Keys -----
  1793.                 <Wait ###.###> inserts a delay of up to ###.### seconds
  1794.                             <Wait #>   =  #     secs
  1795.                             <Wait #.#> =  #.#   secs
  1796.                             <Wait##.##> = ##.## secs
  1797.                                 etc.
  1798.                          spaces are ignored.
  1799.  
  1800.                 ----- Comments (not pasted) are included as:
  1801.                 <* any comment>
  1802.  
  1803.                 ------Sound a Tone of frequency f for d milliseconds
  1804.                 <! f,d>
  1805.                      300 cycles/sec for 1/2 second(500 Milliseconds)
  1806.                      is  <! 300,500>
  1807.  
  1808.                 -----  Single Keys  -----   <------------ Comment ------------>
  1809.                 X:0..9,a..z,A,.Z,rest of Printable Ascii
  1810.                 <Esc>     Escape Key         Response Depemds on Target Window
  1811.                 <Tab>     Tab Key
  1812.                 <Bksp>    BackSpace Key
  1813.                 <Alt>     Alternate Key      Response Depemds on Target Window
  1814.                 <Ctrl>    Control Key        Response Depemds on Target Window
  1815.                 <Shift>   ShiftKey           Response Depemds on Target Window
  1816.                 <Enter>   Enter Key
  1817.                 <Space>   Space Bar
  1818.                 <FX>      Function Keys      Response Depemds on Target Window
  1819.                           X:0---12
  1820.                 ----- Cursor Pad Keys ----
  1821.                 <Home>    Home Key
  1822.                 <End>     End  Key
  1823.                 <PgUp>    PgUp Key
  1824.                 <PgDn>    PgDn Key
  1825.                 <Up>      Up    Arrow Key
  1826.                 <Dn>      Down  Arrow Key
  1827.                 <Left>    Left  Arrow Key
  1828.                 <Right>   Right Arrow Key
  1829.                 <Ins>     Insert Key
  1830.                 <Del>     Delete Key
  1831.  
  1832.                 ------ Other Keys ---------
  1833.                 <PrtScr>  PrintScreen Key
  1834.                 <Pause>   Pause
  1835.                 <Pause> is essentially meaningless   here - if followed
  1836.                         by KeyInput then that is overridden at once.
  1837.  
  1838.                 An example of using a HotKey is as follows
  1839.  
  1840.                 :if( )<Enter>{<Enter><Enter>}<Up><Up><Up><Right><Right>
  1841.  
  1842.                 When that HotKey assignment is executed into a PM Editor and the
  1843.                 cursor is at the left margin, it displays
  1844.  
  1845.                 if( )
  1846.                 {
  1847.  
  1848.                 }
  1849.  
  1850.                 with the cursor appearing inside the ().
  1851.  
  1852.                 If the cursor is not initially at the left margin, it
  1853.                 wil appear as
  1854.  
  1855.                      if( )
  1856.                 {
  1857.  
  1858.                 }
  1859.  
  1860.                where the if( ) is positioned at the cursor location at
  1861.  
  1862.                the time of the call.
  1863. End NEW FEATURE
  1864.  
  1865. There are FOUR Optional Items that may be entered:
  1866.  
  1867.       Command Line: Parameters that need to be passed on the program command line.
  1868.  
  1869.  Working directory: The default directory from which the program is loaded. Many
  1870.                     programs look for their initialization files in the default
  1871.                     directory. The program checks the validity of this directory.
  1872.  
  1873.        Description: This is a description to be displayed on the Task List.
  1874.                     For non-PM programs it will be displayed preceeded by the
  1875.                     Hot-Key assigned (Alt-X / Ctl-X / Qac-X / Pse-X). If no
  1876.                     description is entered  here then the program will display
  1877.                     the Program File Specification in place of the Description.
  1878.                     For PM type programs, the program may modify the Task List
  1879.                     Title so that this will not appear on the Task List but
  1880.                     the name entered by the Program will replace the entry
  1881.                     by HOOK.
  1882.  
  1883.                     Some PM programs may change the TaskList Title.
  1884.  
  1885.   Window Locn/Size: If the program is windowed you may specify its Location and
  1886.                     its Initial Size (both in Pels). xxx is the X location and
  1887.                     yyy the Y location of the Lower Left Corner of the Window
  1888.                     referenced with respect to 0,0 as the lower left corner of
  1889.                     the Screen. wwww is the window width and hhhh its height.
  1890.  
  1891. Pressing the SpaceBar when [[SAVE This Hot Key Assignment]] is HiLited
  1892. saves this entry and enters it into a Record in the Hot Key data
  1893. structure.
  1894.  
  1895. The two Push buttons with CLEAR in them do as indicated. Be very careful
  1896. using the [[CLEAR All Hot Keys]] for that will leave you with no Hot Keys
  1897. active; if you push this by accident you can read back in your latest
  1898. HOOK.HKY from the Menu activates by Alt-Shift-F2.
  1899.  
  1900. If there exist data assigned to a Hot-Key combination, then when the
  1901. user selects the Hot-Key Type and Hot-Key ID and presses Enter after the
  1902. ID selection, the current assignments to that combination are copied
  1903. into the respective Entry fields. IF that Hot Key has been SCHEDULED
  1904. (see below) then a Check will appear in the box adjacent to SCHEDULED.
  1905.  
  1906. These current assignments may be edited and saved. HOWEVER when current
  1907. assignments exist, YOU MAY NOT CHANGE THE HOT KEY TYPE OR HOT KEY ID.
  1908. The program will not allow those changes. If you want to have these
  1909. assignments made to another Hot Key combination, you will have to enter
  1910. them into that de novo and clear the assignments to the Key you no
  1911. longer want to use. It is also possible to make this swtich of Hot Keys
  1912. in the HOOK.DAT file and read it back in.
  1913.  
  1914. After the Hot Key assignment has been SAVED or if there exists a valid
  1915. Hot Key Assignment, the user may SCHEDULE this Hot Key for execution at
  1916. a Set Time for SELECTED days of the week by selcting the push button
  1917.  
  1918.                  SCHEDULE Hot Key Assignment
  1919.  
  1920. this will activate the following Menu for the user to enter data into.
  1921.  
  1922.                      SCHEDULE EXECUTION OPTIONS MENU
  1923.                     =================================
  1924.  
  1925.        Each of the 110 Definable Hot Keys May be Scheduled  to be
  1926.         Started as if the Hot Key were entered from the KeyBoard
  1927.  
  1928.     Select Hour to Run Program   o AM    o PM
  1929.  
  1930.     o 1  o 2  o 3  o 4  o 5  o 6  o 7  o 8  o 9  o 10  o 11  o 12
  1931.  
  1932.     Minutes After Hour   o 00  o 10  o 20  o 30  o 40  o 50
  1933.  
  1934.        Select Day(s) of Week to Run Program
  1935.  
  1936.        { }Sun  { }Mon  { }Tue  { }Wed  { }Thu  { }Fri  { }Sat
  1937.  
  1938.        [(Unschedule This HotKey)]         [(Unschedule All HotKeys)]
  1939.  
  1940.           [(   Cancel   )]                   [( Save and Exit )]
  1941.  
  1942. A given Hot Key mayh be scheduled for execution for any, selected, or
  1943. all days of the Week but ONLY for one time on a given day.  If you wish
  1944. to have the same program executed at different times on a given day then
  1945. you should assign that program to Another Hot Key and Schedule that Hot
  1946. Key for another time.
  1947.  
  1948.                THE SCHEDULE DATA STRUCTURE
  1949.  
  1950. The data structure for savoing the SCHEDULE assignments consists of
  1951. 110 records (one for each Hot Key), each16 bytes long, termionated with
  1952. a CR LF.  The definition of a record is.
  1953. ;---- offsets from start of structure           Hook38
  1954. SKHour             equ  0       ; 0,1,2,.12  Hour of Day on AM PM basis
  1955. SKMinute           equ  1       ; 0,...59    Minutes Past Hour
  1956. SKDay              equ  2       ; a 1 in a day position indicates it is chosen
  1957. SKHotKey           equ  9       ; Hot Key ID Same as from DLL
  1958. SKScanCode         equ 10       ; Scan Code of Hot Key
  1959. SKAMPM             equ 11       ; AM/PM = 0/1
  1960. ;                  equ 12       ; 2 bytes reserved
  1961. ;                  equ 14       ; CR LF Record separator
  1962. LenSchedule   equ    16     ;has same number records as numrecs
  1963.  
  1964.                     PASTING TEXT and HOT-KEY SEQUENCES
  1965.                     ==================================
  1966.  
  1967. It is possible to assign a Text String to be pasted into the Window
  1968. having the Keyboard Focus or to assign a Sequence of HotKeys  to be
  1969. activated to ANOTHER Hot-Key.
  1970.  
  1971. This assignment is done in the Define Hot Keys Menu. The user first must:
  1972.  
  1973.              Select a HotKey for the assignment.
  1974.  
  1975.              In the Prgm. File Spec. field the first entry must be a "-"
  1976.              or a "=" character. This is how the program identifies the
  1977.              entry as a  PASTE  sequence rather than as an executable
  1978.              program.
  1979.  
  1980.              OPTIONALLY the user may make an entry in the Description Field.
  1981.              If no entry is made here, the entry in the Prgm. File Spec.
  1982.              field is displayed when the option to display the descriptions
  1983.              is used. All other entries are ignored.
  1984.  
  1985.                         <<<<< PURE TEXT STRINGS >>>>>
  1986.  
  1987.              If a  pure text string is entered, e.g.
  1988.  
  1989.              -This is a pure Text String
  1990.                   or
  1991.              =This is a pure Text String
  1992.  
  1993.              and assigned to the Hot Key, say Shift-Ctrl-A, then when
  1994.              Shift-Ctrl-A is pressed the string will be posted to the
  1995.              Window having the Keyboard Focus as a series of WM_CHAR
  1996.              messages, each message holding one of the characters in
  1997.              the string. If the Window having the  Keyboard Focus does
  1998.              not have a message queue or if that message queue does not
  1999.              interpret the WM_CHAR messages, nothing will appear.
  2000.  
  2001.              Any  ASCII character, even those created by using Alt-##,
  2002.              where # is a key on the numerical key pad will be posted.
  2003.              How and if they are interpreted depends on the target
  2004.              Window. For example, if you have an OS/2 command window as
  2005.              the target and post a message with the escape character (27
  2006.              or ) in it then the command line interprets that as
  2007.              aborting the command line and no member of the string after
  2008.              it will appear. If you assign -dir <CR>  (<CR> = Alt-13 =
  2009.              ascii 13 = Carriage Return) to a Hot Key and activate it
  2010.              when an OS/2 Command window has the focus it will do the
  2011.              dir command.
  2012.  
  2013.              In general including such control characters will lead to
  2014.              nothing because of the interpretation problem but there are
  2015.              some special cases, as those noted above, where something
  2016.              will occur.
  2017.  
  2018.                        <<<<< HOT KEY SEQUENCES >>>>>
  2019.  
  2020.              The text string may also contain a sequence of HotKeys to
  2021.              execute. Hot Keys are entered in the string as:
  2022.  
  2023.               \A|aX        for the HotKey      Shft-Alt-X
  2024.               \C|cX        for the HotKey      Shft-Ctl-X
  2025.               \Q|qX        for the HotKey       Alt-Ctl-X
  2026.  
  2027.              There are two additional options that are useful with the
  2028.              HotKeys. Each of these may be used up to ten times in a
  2029.              given assignment sequence.
  2030.  
  2031.              Each of these options inserts a time delay from the
  2032.              beginning of the activation of the sequence.
  2033.  
  2034.              The sequence \rxxx where xxx is any integer inserts a
  2035.              time delay of xxx seconds from the activation of the
  2036.              Hot Key and then executes a Carriage Return into
  2037.              the Window with the Keyboard Focus
  2038.  
  2039.              The sequence \dxxx followed by a HotKey designation
  2040.              (no spaces between \dxxx and the HotKey spec) inserts
  2041.              a time delay of xxx seconds from the activation of the
  2042.              HotKey before executing the designated HotKey.
  2043.  
  2044.              These are useful for seuqences that may reauire a Carriage
  2045.              Return after loading an initial program (such as an Internet
  2046.              Access Programs) and then want to load another program
  2047.              that requires the first be active (such as an E Mail program).
  2048.              Since the first program may take many seconds to complete
  2049.              the time delay before the execution of the second allows
  2050.              this to happen. For each of these a series of beeps is
  2051.              sounded when the time delay is met.
  2052.  
  2053.              These time delays can certainly be system dependent since
  2054.              how long it takes a given program to load will depend on that
  2055.              as well as perhaps other factors.
  2056.  
  2057.              It may be useful to give some examples that I use myself.
  2058.  
  2059.              I have assigned Loading my Internet Access Program to
  2060.              Alt-Ctrl-J. When this program is loaded it does not dial
  2061.              until a CR is made. The program takes a few seconds to load
  2062.              since it is done by a CMD file that has to turn off my fax
  2063.              software to free u the modem. What I want to do first after
  2064.              that is to see if there is any e mail and for that I use my
  2065.              PM_Mail program which is assined to the HotKey Alt-Ctrl-e .
  2066.              It must be loaded before the modem dials or after the
  2067.              Internet Connect is made or there is an error. It is is
  2068.              loaded after the internet connect is made, it automatically
  2069.              gets any waiting e mail so I would like it to load that
  2070.              way. My internet connect takes about 60 seconds so I need
  2071.              to wait that time after the CR on the Internet program.
  2072.              Thus my assignment for this, in my case to Shift-Ctrl-4 is
  2073.  
  2074.              -\qj\r6\d65\qe
  2075.  
  2076.              the \qj\r6  loads the Internet Access Program and does
  2077.              the CR 6 seconds later that starts the connect.
  2078.  
  2079.              the\d65\d\qe  loads the PM Mail program assigned to Alt-ctrl-e
  2080.              after a 65 second delay (FROM THE BEGINNING). This allows
  2081.              for my system sufficient time for the connect to be made.
  2082.  
  2083.              It is important to note that the sequence of message postings
  2084.              are not serialized like DOS programming and there is no
  2085.              guarantee of the order. The time delays for a CR and for
  2086.              executing one HotKey commence  from the beginning of the
  2087.              Paste HotKey activation.
  2088.  
  2089.              If the above sequence  -\qj\r6\d65\qe were changed to
  2090.              add another HotKey at the end, such as
  2091.  
  2092.              -\qj\r6\d65\qe\aw
  2093.  
  2094.              where in my case Shift-Alt-w is the HotKey to activate the
  2095.              program displaying the SWAPPER.DAT information, then
  2096.              when the sequence is activated, the  first program to
  2097.              appear loaded would be the last one, since it loads the
  2098.              fastest and has no time dealy restriction.
  2099.  
  2100.              Another example ( a simple one) that I use is one that
  2101.              loads a command window (HotKey Shift-Alt-1), another
  2102.              command window (HOt Key  Shift-Alt-2) and an Editor
  2103.              (Shift-Alt-v). The string sequence is:  -\a1\a2\av
  2104.  
  2105.              In general there is no practical use for intermixing
  2106.              Hot Keys and Text due to the serialization problem.
  2107.  
  2108.          USING SHIFT-ALT-F9 TO ASSIGN A HOTKEY TO ACTIVE PROGRAM
  2109.  
  2110. This method, which is applicable only to OS/2 PM or Windowed Text
  2111. applications, allows the user to assign a HotKey to a running program.
  2112. (It cannot be used to Assign Opening a Folder to a HotKey)
  2113.  
  2114. Pressing Shift-Alt-F9 brings up a Screen which asks the user if he/she
  2115. wants to assign a HotKey to a user Selected Program. If the response is
  2116. Yes then another Screen is presented that directs the user to Make the
  2117. Target Program Active and then Press Shift-Alt-F9 again OR to abort with
  2118. Shift-Ctrl-Esc.
  2119.  
  2120. If the user continues with the Assignment by Pressing Shift-Alt-F9 after
  2121. the target program is made active, another screen is presented
  2122. displaying the HotKey options (or again Shift-Ctrl-Esc to abort). Tf the
  2123. user continues by typing in a HotKey to assign, then a check is done to
  2124. see if that HotKey is currently assigned and if so, that Information is
  2125. presented and an option given to Continue or Abort. If Continue is
  2126. chosen the assignment is made.
  2127.  
  2128. The description that is entered is the Name of the EXE file for the program.
  2129. That can be altered or command line options by using Shift-Alt-F3 to call
  2130. up the more elaborate menu for editing the parameters of the HotKey.
  2131.  
  2132.               USER DEFINED DATA FORMAT In HOOK.DAT
  2133.  
  2134. User defined hot-key assignments may also be made in the text file
  2135. HOOK.DAT which is in the directory X:\HOOK\ . The default file loaded by
  2136. INSTALL has a series of comments in it that describe the format of
  2137. making key assignments and there are a number of assignments made in
  2138. that file as examples. The user can delete them, reassign them or
  2139. whatever. That file is reproduced below.
  2140.  
  2141. Please Note that when HOOK is active, any changes to HOOK.DAT may be made 
  2142. active by pressing Shift-Ctlr-UpArrow. IF the EDIT option was chosen from the
  2143. Pop Up Menu the changes automatically are read into HOOK.EXE when the Editor 
  2144. is exited. Either choice re-reads this file into the Hot Key Record Structure.
  2145. If a Hot Key exists that is defined in HOOK,DAT, it is overwritten, otherwise
  2146. current Hot Keys are not disturbed and any Hot Keys defined in HOOK.DAT not
  2147. in the Hot Key record structure are added to it.
  2148.  
  2149. Displayed below is the content of HOOK.DAT supplied for you initially.
  2150.  
  2151.  ***************** Beginning of File HOOK.DAT *****************
  2152. ;; HOOK.DAT Key Assignment file for HOOK.EXE   Thu  07-06-95
  2153. ;;
  2154. ;; This file  MUST be located in the directory X:\HOOK????
  2155. ;; where X and ???? were chosen by the user at install time
  2156. ;;
  2157. ;; NB the actuating Key strokes are Shift-Alt-X, Shift-Ctrl-X, Alt-Ctrl-X
  2158. ;;
  2159. ;; <<<<<<<<<<<<<<<<<<<<<<< The format is as follows >>>>>>>>>>>>>>>>>>>>>>
  2160. ;;
  2161. ;; A ";" indicates a comment and text from there to end of line is ignored
  2162. ;;
  2163. ;; Blank Lines are not allowed - place at least one ";" on any line
  2164. ;;
  2165. ;; There must be at least 1 space between each field and the next field.
  2166. ;;
  2167. ;; The first field in a line is either A#, C# or Q# indicating an assignment to
  2168. ;; Shift-Alt-#, Shift-Ctrl-# or Alt-Ctrl-# where #  is  0,1,2,3,4,5,6,7,8,9 or
  2169. ;; AX, CX, QX indicating assignment to to Shift-Alt-X, Shift-Ctrl-X, Alt-Ctrl-X
  2170. ;; where X is any letter from a .. z.
  2171. ;;
  2172. ;; NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW
  2173. ;; To assign Alt-Pause or Shift-Pause the first field is either
  2174. ;; PA for Alt-Pause or PS for Shift-Pause
  2175. ;;
  2176. ;; No distinction exists between LowerCase or UpperCase.
  2177. ;;
  2178. ;; The next field is optional - it allows the user to include a descriptive
  2179. ;; text (up to 20 characters long) to describe the program. It will appear
  2180. ;; in the Task List after the Alt|Ctl|Qac-X Hot Key indicator
  2181. ;; The text to be included must be between @-------@ as
  2182. ;; @Fox Pro 2.0@
  2183. ;;
  2184. ;; The next set of (4) fields are collectively optional and allow the user
  2185. ;; the ability to set the location and size of the Window.
  2186. ;; They are entered as           x|X### y|Y### w|W### h|H###
  2187. ;; where x|X y|Y w|W h|H denote the coordinates of the lower left corner
  2188. ;; of the window and w|W / h|H denotes the Width / Height of the window.
  2189. ;; All sizes are given in PELS so that a set of values OK for one screen
  2190. ;; resolution will appear differently for another.
  2191. ;; x0 y0 w300 h400 will create a window located at the lower left corner
  2192. ;; of the Screen whose size is 300 pels wide and 400 pels high.
  2193. ;;
  2194. ;; The next field has the following options.
  2195. ;;
  2196. ;; 9 means that the key will not be recognized. This can be accomplishied
  2197. ;;   as well by commenting that assignment out with ";
  2198. ;; ;Ad        means that Shift-Alt-D is not assigned
  2199. ;; Ad 9 a 0   means that Shift-Alt-D is not assigned
  2200. ;;            the 9 must be followed by any letter a space and "0"
  2201. ;;
  2202. ;; OR just omitting Ad from the text also means it is not assigned
  2203. ;;
  2204. ;; Otherwise the field has the following meaning
  2205. ;;
  2206. ;; 0   Allows the Shell to establish the session type - best as a rule
  2207. ;; 1   Starts program as Full Session OS/2
  2208. ;; 2   Start Program in Windowed Session for programs using Base Video System
  2209. ;; 3   Start Program in Windowed Session for programs using PM services
  2210. ;; 4   Start Program in Full Screen DOS session
  2211. ;; 7   Start Program in Windowed DOS session
  2212. ;;
  2213. ;; The next field is the file spec of the program to be executed and the
  2214. ;; field after that is either a "0" indicating no  command line parameters
  2215. ;; or the command line parameters. If the command line parameters contain
  2216. ;; any spaces the command line parameters must be contained within "".
  2217. ;;
  2218. ;; Ae 0 c:\os2\e.exe c:config.sys ; loads the system editor included in OS/2
  2219. ;;                                  to edit c:config.sys and assigns  this
  2220. ;;                                  command to Shift-Alt-e
  2221. ;;
  2222. ;; Ae @Edit Config.sys@0 c:\os2\e.exe c:config.sys ; loads the system editor included in OS/2
  2223. ;;                                  to edit c:config.sys and assigns  this
  2224. ;;                                  command to Shift-Alt-e displays description
  2225. ;;                                  "Edit Config.sys" in Task List
  2226. ;;
  2227. ;; Generically speaking the format below assigns programfilespec to Shift-Alt-x
  2228. ;;
  2229. ;; Ax 0 programfilespec "program command line" ;if there are command line parms
  2230. ;;
  2231. ;; Ax 0 programfilespec  0                     ;if no command line parms
  2232. ;;
  2233. ;; The  programfilespec must contain the extension .COM / .EXE / .BAT
  2234. ;; BAT files can be loaded just like EXE files but CMD files must be
  2235. ;; passed as strings to the Command Processor. If the command processor
  2236. ;; is CMD.EXE the the string must be "/C X:\dirname\fname.CMD".
  2237. ;; The 4os2 command processor does not require the /C parameter.
  2238. ;;
  2239. ;; HOOK  uses the DosStartSession Function of the OS/2 API to load programs.
  2240. ;; It is documented on page 2-345 of the Control Program Functions Manual.
  2241. ;;
  2242. ;; DosStartSession does not like to load a CMD file directly so they must be
  2243. ;; loaded with a command processor as
  2244. ;;
  2245. ;; A5 0 c:\os2\cmd.exe "/C abcdef.cmd" ; abcdef.CMD loaded by OS/2 command processor
  2246. ;;
  2247. ;; The  4os2 command processor does not require the /C parameter
  2248. ;; A5 0 c:\4os2path\4os2.exe  abcdef.cmd ; abcdef.CMD loaded by 4OS2 command processor
  2249. ;;
  2250. ;; To assign a program to a key follow the examples/rules above
  2251. ;;
  2252. ;; If you edit this file while HOOK is Active, press Shft-Alt-UpArrow
  2253. ;; to re-read this file in and redefine the Active Set of Keys
  2254. ;;
  2255. ;; !!IF  this file is edited from the HOOK Menu, it is automatically re-read!!
  2256. ;;
  2257. ;; In the Task List Shift-Alt-Key assignments are identified as Alt-X
  2258. ;; In the Task List Shift-Ctl-Key assignments are identified as Ctl-X
  2259. ;; In the Task List Alt-Ctrl-Key  assignments are identified as Qac-X
  2260. ;;
  2261. ;; Please Note that As is assigned to Search and Replace Applet which may
  2262. ;; not be valid for other than vs.2.1 and Cw  for Windows is valid only for
  2263. ;; OS/2 2.0/2.1 not for WARP!!
  2264. ;;
  2265. Q3 @3:OS/2 Command@ 0 c:\os2\cmd.exe 0               ;OS/2 window using OS/2 Command Processor
  2266. A1 @1:OS/2 Command@ 0 c:\os2\cmd.exe 0               ;OS/2 window using OS/2 Command Processor
  2267. A2 @2:OS/2 Command@ 0 c:\os2\cmd.exe 0               ;OS/2 window using OS2 Command Processor
  2268. A3 @3:OS/2 FScreen@ 1 c:\os2\cmd.exe 0               ;OS/2 Full Screen using OS/2 Command Processor
  2269. A4 9 x 0                            ;Key not assigned
  2270. A5 9 x 0                            ;Key not assigned
  2271. A6 9 a 0                            ;Key not assigned
  2272. A7 9 x 0                            ;Key not assigned
  2273. A8 9 a 0                            ;Key not assigned
  2274. A9 9 a 0                            ;Key not assigned
  2275. A0 9 x 0                            ;Key not assigned
  2276. Aa 9 a 0                            ;Key not assigned
  2277. Ab 9 x 0                            ;Key not assigned
  2278. Ac 9 x 0                            ;Key not assigned
  2279. Ad 9 a 0                            ;Key not assigned
  2280. Ae @System E Editor@ 0 c:\os2\e.exe 0    ;OS/2 e.exe  system editor
  2281. Af 9 x 0                            ;Key not assigned
  2282. Ag 9 x 0                            ;Key not assigned
  2283. Ah 9 x 0                            ;Key not assigned
  2284. Ai 9 x 0                            ;Key not assigned
  2285. Aj 9 x 0                            ;Key not assigned
  2286. Ak 9 x 0                            ;Key not assigned
  2287. Al 9 x 0                            ;Key not assigned
  2288. Am 9 x 0                            ;Key not assigned
  2289. An 9 x 0                            ;Key not assigned
  2290. Ap 9 z 0                            ;Key not assigned
  2291. Aq 9 x 0                            ;Key not assigned
  2292. Ar 9 z 0                            ;Key not assigned
  2293. As @Search and Seek@ 0 c:\os2\apps\pmseek.exe 0       ;OS/2 Search and Scan Applet
  2294. At 9 z 0                            ;Key not assigned
  2295. Au 9 z 0                            ;Key not assigned
  2296. Av 9 x 0                            ;Key not assigned
  2297. Aw 9 z 0                            ;Key not assigned
  2298. Ax 9 z 0                            ;Key not assigned
  2299. Ay 9 z 0                            ;Key not assigned
  2300. Az 9 z 0                            ;Key not assigned
  2301. C1 @1:DOS Command@ 7 c:\os2\mdos\command.com  0     ;DOS window using built in DOS
  2302. C2 @2:DOS Command@ 7 c:\os2\mdos\command.com  0     ;DOS window using built in DOS
  2303. C3 @3:DOS FScreen@ 4 c:\os2\mdos\command.com  0     ;Full Screen using built in DOS
  2304. C4 9 a 0                            ;Key not assigned
  2305. C5 9 a 0                            ;Key not assigned
  2306. C6 9 a 0                            ;Key not assigned
  2307. C7 9 a 0                            ;Key not assigned
  2308. C8 9 a 0                            ;Key not assigned
  2309. C9 9 a 0                            ;Key not assigned
  2310. C0 9 a 0                            ;Key not assigned
  2311. Ca 9 a 0                            ;Key not assigned
  2312. Cb @QBasic@ 7 c:\os2\mdos\qbasic.exe 0       ;QBasic from dos in DOS window
  2313. Cc 9 a 0                            ;Key not assigned
  2314. Cd 9 a 0                            ;Key not assigned
  2315. Ce 9 a 0                            ;Key not assigned
  2316. Cf 9 c 0                            ;Key not assigned
  2317. Cg 9 b 0                            ;Key not assigned
  2318. Ch 9 c 0                            ;Key not assigned
  2319. Ci 9 c 0                            ;Key not assigned
  2320. Cj 9 d 0                            ;Key not assigned
  2321. Ck 9 e 0                            ;Key not assigned
  2322. Cl 9 f 0                            ;Key not assigned
  2323. Cm 9 c 0                            ;Key not assigned
  2324. Cn 9 g 0                            ;Key not assigned
  2325. Co 9 h 0                            ;Key not assigned
  2326. Cp 9 c 0                            ;Key not assigned
  2327. Cq 9 c 0                            ;Key not assigned
  2328. Cr 9 i 0                            ;Key not assigned
  2329. Cs 9 j 0                            ;Key not assigned
  2330. Ct 9 k 0                            ;Key not assigned
  2331. Cu 9 l 0                            ;Key not assigned
  2332. Cv 9 m 0                            ;Key not assigned
  2333. Cw@Windows 3.1@ 4 c:\os2\mdos\winos2\win.com 0   ;OS/2 DOS Win 3.1 Full Screen
  2334. Cx 9 o 0                            ;Key not assigned
  2335. Cy 9 p 0                            ;Key not assigned
  2336. Cz 9 q 0                            ;Key not assigned
  2337. Pa 9 q 0                            ;Key not assigned  Alt-Pause
  2338. Ps 9 q 0                            ;Key not assigned  Shift-Pause
  2339. <***************** End of File HOOK.DAT *****************>
  2340.  
  2341. When programs are loaded by a Hot-Key their title appears in the
  2342. Task List (actuated by Ctrl-Esc) according to the following rules.
  2343.  
  2344. IF A TITLE WAS NOT ASSIGNED USING @ASSIGNED TITLE@ then
  2345.  
  2346.    If assigned to a Shift-Alt key combination it appears as
  2347.        Alt-X name_as_assigned_in_field_3     where X is key assigned
  2348.  
  2349.    If assigned to a Shift-Ctrl key combination it appears as
  2350.        Ctl-X name_as_assigned_in_field_3     where X is key assigned
  2351.  
  2352.    If assigned to a Alt-Ctrl key combination it appears as
  2353.        Qac-X name_as_assigned_in_field_3     where X is key assigned
  2354.  
  2355.  
  2356. In each case the string "name_as_assigned_in_field_3" contains up to
  2357. a total of 24 characters from the filespec of the program to be
  2358. loaded appended to "Alt-X ",to "Ctl-X " or to "Qac-X ".
  2359.  
  2360. The reason for this is two fold. Most importantly it is because the
  2361. program uses the Task List titles to determine if a program is
  2362. currently active when that hot-key combination is struck and it
  2363. switches to the running program. Secondly in the Task List it
  2364. serves as a convenient reminder of the current hot-key assignments.
  2365.  
  2366.  
  2367. The examples below reflect the Task List Title  for some of the
  2368. assignments above in the sample DAT file. IF THEY DID NOT
  2369. INCLUDE AN ASSIGNED TITLE IN @.......@
  2370.  
  2371. Alt-E c:\os2\e.exe                 ;OS/2 e.exe  system editor
  2372. Alt-S c:\os2\apps\pmseek.exe       ;the pmseek program
  2373. Ctl-W c:\os2\mdos\winos2\win.c     ;Win 3.1 (note the "om" missing)
  2374. Ctl-3 c:\os2\mdos\command.com      ;DOS window
  2375.  
  2376. Please note that if the Alt-E assignment had been made as
  2377. Ae 0 C:\OS2\e.exe 0                 ;OS/2 e.exe  system editor
  2378. then its Task List title would appear as
  2379. Alt-E C:\OS2\e.exe 0
  2380.  
  2381. IF the program had a title assigned between @ASSIGNED TITLE@ then
  2382. that text would appear after the Alt-X or Ctl-X in the Task List.
  2383.  
  2384. Programs not loaded by HOOK hot-keys will have their Task List titles
  2385. reflect how the program is written. PM programs may have their Task List
  2386. title reflect either the Program Name or the title that appears in their
  2387. Window when loaded. In some cases the title bar is updated dynamically.
  2388.  
  2389.  
  2390. The hot-keys Shift-Alt-/ ,Shift-Ctl-/ and Alt-Ctl-/ display on the
  2391. screen a listing of the Hot-Key assignments in HOOK.DAT relevant to
  2392. those hot keys. This screen listing is automatically read from the
  2393. active listings in HOOK.EXE and displayed. This screen is removed by Esc
  2394. or Shift-Alt-Esc.
  2395.  
  2396. It is also useful to load separate window programs seamlessly so that
  2397. they may be loaded and switched between with hot keys. The line below
  2398. indicates this for MathCad assigned to Shift-Alt-M for OS/2 2.1
  2399.  
  2400. Am @Win MathCad@ 3 4os2.exe "Start /win /c e:\winmcad\mcad.exe &. exit"
  2401.   ;OS/2 DOS Win 3.1 Windowed Switchable
  2402.  
  2403. The command processor defined by the OS/2 COMSPEC variable in the
  2404. environment is used for the PopUp Command Window activated by the key
  2405. combination Shift-Alt-Ins.
  2406.  
  2407. HOOK.EXE may be started by placing the appropriate command in a
  2408. STARTUP.CMD file, by entering it from an OS/2 Window or from a Folder
  2409. Icon by creating a Program Folder and assigning the Hook location to the
  2410. Menu in that folder.
  2411.  
  2412. From the command line or startup.cmd use:
  2413.  
  2414. Start X:\HOOKdir\HOOK     IF X:\HOOKdir not in Path
  2415.  
  2416. Start HOOK                IF X:\HOOKdir is in Path
  2417.  
  2418. NEW : A 2 character parameter may be passed to HOOK when it is loaded.
  2419.       The format is  HOOK XY
  2420.       where X indicates the Hot Key Type : A|a is Shift-Alt
  2421.                                            C|c is Shift-Ctl
  2422.                                            Q|q is Alt-Ctl
  2423.       and X :0,1,...9,A,B,...Z is the Hot Key identifier.
  2424.       It can be in either lower case or upper case.
  2425.  
  2426.       Examples:
  2427.       Hook q9  will load hook and immediately execute the Hot Key
  2428.                assigned to Alt-Ctl-9
  2429.  
  2430.       Hook Ce  will load hook and immediatley execute the HotKey
  2431.                assigned to Shft-Ctl-e
  2432.  
  2433.       Hook at  will load hook and immediatley execute the HotKey
  2434.                assigned to Shft-Alt-t
  2435.  
  2436.       Since the Paste option allows you to assign strings of HotKeys to
  2437.       execute, you can assign a series of programs to load to such a
  2438.       string  and pass that HotKey on the command Line.
  2439.  
  2440. It is important to remember that the status of the DLL configuration may
  2441. affect the playing back of macros. In particular if the macro is a
  2442. playback of keystrokes, the target window must have the focus and this
  2443. means that the default DLL setting is required.
  2444.  
  2445.                       The PASTE Mode
  2446.  
  2447. PASTE mode is a new option offered for HOOK users.
  2448.  
  2449. It is switched On/Off by the HotKey combination > Shft-Alt-SpaceBar
  2450.  
  2451. When PASTE Mode is first initiated a few Beeps are sounded, the Title
  2452. bar of the HOOK window changes to display "Paste" instead of "KB Hook"
  2453. and the Frame Window of HOOK flashes.
  2454.  
  2455. In PASTE mode the built in HotKeys retain the same functionality except
  2456. that whenever a reference is made to HotKeys, that reference is with
  2457. respect to the PASTE Mode.
  2458.  
  2459. Thus, if in PASTE mode you press Shift-Alt-?  or Shift-Ctl-? or
  2460. Alt-Ctrl-? the display will be that for the Descriptions relating
  2461. to the HotKey assignments for the PASTE Mode text descriptions.
  2462.  
  2463. When You press a  User defined HotKey in PASTE mode it will paste the
  2464. "text" defined for that key into the Window with the Keyboard Focus.
  2465.  
  2466. If you press Shift-Alt-F3 you will get the Screen prompting you to enter
  2467. a HotKey to Addign or Edit and when you do, you will get the Menu Screen
  2468. for the PASTE mode.
  2469.  
  2470. To return to normal HotKey reponse just hit Shift-Alt-SpaceBar
  2471.  
  2472.  
  2473. The HotKeys Assignment Menu - PASTE Mode Screen Displayed below is the
  2474. format of the Define Hot Keys Screen Menu when PASTE Mode is Active
  2475.  
  2476.  
  2477.               HotKeys Assignment Menu - PASTE Mode
  2478.  
  2479.                  Assigning HotKey   Shift-Alt-X
  2480.  
  2481.   Paste String:  [                                                 ] CR Accepts
  2482.  
  2483.    Description:  [                                                 ] CR Accepts
  2484.  
  2485.  
  2486.                          [(  SAVE Hot Key Assignment  )]
  2487.  
  2488.   [(CLEAR Selected Hot Key and EXIT)]          [(CLEAR All Hot Keys and EXIT)]
  2489.  
  2490.               Cursor UP/Dn/Left/Right Keys Moves Within Groups
  2491.                   SpaceBar or Left Mouse Button to Select
  2492.                     Tab Key to Next Group  <Esc> Aborts
  2493.  
  2494.                                [(EXIT)]
  2495.  
  2496. -------------------------- End of Menu -----------------------------------
  2497.  
  2498. The only required field here is the String to be Pasted.
  2499.  
  2500. The maximum string length is 298 characters and may be pure Ascii Text or
  2501. it may include formatting in the <...> format.
  2502.  
  2503.  
  2504.  
  2505.  
  2506. RECORDING AND PLAYING BACK MACROS
  2507.  
  2508. To begin the recording of KeyStrokes and/or Mouse Actions press
  2509. Shift-Ctrl-LeftArrow or Shift-Ctrl-[. The program window will display a
  2510. Window Message Prompting you with respect to your first recording action
  2511. and will then display "Recording" as long as the recording is on. To
  2512. conclude the recording press Shift-Ctrl-RightArrow or Shift-Ctrl-] and
  2513. the window will be closed indicating recording is ended. You will also
  2514. at this point be presented a file dialog box to select a name under
  2515. which to save the Macro. To abort Saving the Macro just enter Esc.
  2516.  
  2517. The availability of the optional Shift=Ctrl-[ to begin Macro recording
  2518. and Shift-Ctrl-] to end recording is made to make recording and play
  2519. back easier for those editors (such as e.exe, epm.exe and others) which
  2520. use the Shift-Cursor keys for Text marking and Cut and Paste operations.
  2521.  
  2522. To PlayBack the Macro just recorded press the Shift_Ctrl-Ins key and
  2523. the window will display the message "Playback" while it is playing back
  2524. the events recorded.
  2525.  
  2526. >New> When "Playback" is displayed  pressing the Esc Key will abort
  2527.       the playback.
  2528.  
  2529. A Macro may also be saved after it has been recorded (if the original
  2530. prompt for saving was ignored) by pressing Shift-Ctrl-PgDn. A
  2531. dialogue box will be presented prompting you for the name of the macro
  2532. file to be stored. The macro is written to X:\HOOKdir with the
  2533. assigned name in two forms. One form is the binary form that is playable
  2534. back and has the extension HEX. The other form is in ASCII with the same
  2535. name but extension MAC and is a listing of the following parameters
  2536. recorded in the Macro; the values of all except TaskListName are given
  2537. in HEX.(X above is the drive letter chosen by the user in Install.)
  2538.  
  2539. Handle MessageID msgParam1 msgParam2  msgTime  X_ScreenP Y_ScreenP TaskListName
  2540.  
  2541. To play back a saved Macro, use Shift_Ctrl-PgUp to activate a
  2542. dialogue box that will present the list of saved macros. When one is
  2543. selected it is read into memory and is activated by Shift_Ctrl-Ins
  2544. Any macro that is created or that is read into memory stays there until
  2545. replaced by another and thus can be repeatedly used. If a macro is
  2546. already in memory it can be played back(repeatedly) by Shift-Ctrl-Ins.
  2547.  
  2548. Macros may also be played back from the command line using PLAYBACK.EXE
  2549. or PLAYBAKF.EXE(FASTER) for general Macros. From an OS/2 command line :
  2550.  
  2551.    playback  filespec
  2552.        or
  2553.    playbakf  filespec
  2554.  
  2555. where filespec is the drive:\directory\macroname.hex specification for
  2556. the binary file saved by HOOK when a macro was created.
  2557.  
  2558. Those commands may also be assigned to Hot-Keys so that frequently used
  2559. Macros are readily available.
  2560.  
  2561. Again remember that for Key Stroke macros the target window must have
  2562. the focus to receive the keystrokes - this implies the DLL default
  2563. configuration option.
  2564.  
  2565. LIMITATIONS OF MACRO RECORDING
  2566.  
  2567. The Macro recorder does not record Alt-Esc or Alt-Tab key strokes.
  2568.  
  2569. It will record and play back messages for actions initiated by the Alt
  2570. Key and then choosing options from the Control Frame Menu, such as Alt-x
  2571. to maximize the window, Alt-r to restore the window, etc. If you record
  2572. a macro that includes MOVING or RESIZING the window, when that aspect of
  2573. the macro is entered, for reasons I do not yet understand, the system
  2574. waits for you to move the cursor keys to either resize or move the
  2575. window.
  2576.  
  2577. It does record the Ctrl-Esc key sequence and its actions and other
  2578. keyboard entries including the Shift-ALt|Ctrl-X keys assigned to this
  2579. program and their actions and also mouse actions. It does not however
  2580. faithfully play back everything recorded for reasons I also do not
  2581. frankly understand. For instance if you assign to a Macro the sequence
  2582. (from an OS/2 window) Help DownCursor DownCursor CR, it does not play
  2583. back the DownCursor DownCursor CR sequence though it does open the Help
  2584. Window.
  2585.  
  2586. However if you save (e.g.) the sequence "Help Dir" from a command line it
  2587. will play that back correctly.
  2588.  
  2589. When you are recording anything from the Command Line, after using the
  2590. Shift-Ctrl-LeftArrow (or Shift-Ctrl-[ ) key strokes to start the macro,
  2591. you must use the Mouse to activate the window you were in or else an
  2592. assigned Shift-xxx-xxx action to get back into that window. This is
  2593. because displaying the Message "Recording" in the Hook window makes that
  2594. the active window. There is a Prompt reminding the user to make the
  2595. shift to the desired active window.
  2596.  
  2597. When activating a Macro you must be careful that your setup is similar
  2598. to that used when recording it, particularly if writing text is a part
  2599. of the scenario - you might get the text written back in a non-intended
  2600. window.
  2601.  
  2602. Since the macros when recorded, record positions in screen coordinates,
  2603. which are absolute relative to the bottom left corner, any actions
  2604. depending on a mouse action such as clicking on a minimize or maximize
  2605. button will be sensitive to where that button is on the screen. If a
  2606. window is not displayed at exactly the same position as it was when
  2607. recording, those mouse actions will not be what is intended.
  2608.  
  2609. The macros do a good job of recording keystrokes and their playback is
  2610. faithful and fast. However if the Keystrokes were recorded from a
  2611. non PM window they will only play back to a non-PM window and vice
  2612. versa.
  2613.  
  2614. I find the macros most useful for storing and setting up different
  2615. groups of windows. For instance I have one mode of operations where I
  2616. have my editor open in two different OS/2 windows, 2 DOS windows open
  2617. with different versions of FoxPro in them and an OS/2 window for command
  2618. line use. I have that set of keystrokes assigned to a macro I have named
  2619. to FOXLOAD.HEX and  when I want to re-establish that set of windows I
  2620. load it into memory using Shift_Ctrl-PgUp to select and load it and play
  2621. it back with Shift-Ctrl-Ins.
  2622.  
  2623. This can now be done more easily by assigning the sequence of KeyStrokes
  2624. to a HotKey and executing that HotKey.
  2625.  
  2626. MACRO RECORDING now omits WM_MOUSEMOVE messages.
  2627.      This speeds up playback and loses nothing since those messages
  2628.      just display the mouse pointer moving from one location to
  2629.      another. The actions at the end of that are unchanged.
  2630.  
  2631. Finally the Buffer used to store the messages is of finite size. Each
  2632. message is 28 bytes long and the buffer size is 56000 bytes and thus
  2633. holds  2000 messages. If your recording exceeds the buffer size the
  2634. program notifies you.
  2635.  
  2636. The program macro PlayBack facility will now run under either OS/2
  2637. version 2.0 /2.1/WARP as it determines the Handle of the Task List
  2638. Window on the Fly, in this respect it should be immune to updates. The
  2639. messageID of the Task List is not documented but it is 082H and it has a
  2640. fixed handle value that changed from version 2.0 to 2.1. The value is
  2641. stored in the Task List Buffer at offset 8, which is where I get it on
  2642. loading HOOK.
  2643.  
  2644. Currently the macros are not played back at the speed at which they were
  2645. recorded but somewhat faster. This is because it is presumed and
  2646. certainly I do, that one uses Macros for convenience and speed. That
  2647. sometimes gives a problem, especially if mouse movements are involved.
  2648. For opening up icons on the screen I find it convenient to follow the
  2649. procedure of going to the desktop, (or other window as the case may be)
  2650. and clicking the left mouse button to establish the location, then press
  2651. the Home key to bring you to the upper left icon of that window, and
  2652. then use the cursor keys to bring you to the desired icon to open and
  2653. then press enter to open it and so on.
  2654.  
  2655. DOS WINDOWED SESSIONS and FULL SCREEN SESSIONS
  2656.  
  2657. There are limitations to using the Macro Recorder from a DOS session. It
  2658. will record and play back actions reflecting OS/2 aspects, such as using
  2659. the Alt key to activate a frame menu and select an options, such as
  2660. Alt-x (maximize),etc or Ctrl-Esc to activate the Task List and make a
  2661. selection but it will not record ordinary keyboard entry or any activity
  2662. from within a DOS session relating to the DOS software program. That is
  2663. because in DOS the PM message queue is not active and normal DOS KB
  2664. TSR's are required if you need to intercept Keystrokes in DOS.
  2665.  
  2666. A similar comment holds for OS/2 Full Screen. There monitors are
  2667. required to read Keyboard Activity and the PM message queue does not
  2668. apply.
  2669.  
  2670. If I need to use an application in Full Screen, then I use Ctrl-Esc
  2671. to bring up the TaskList window and from there the Hot Keys are valid
  2672. since you are in PM.
  2673.  
  2674. Notwithstanding the limitations above, I have found this most useful and
  2675. it is worth playing around with to understand both its utility and its
  2676. limitations.
  2677.  
  2678. FULL SCREEN APPLICATIONS
  2679.  
  2680. INCLUDING FULL SCREEN APPLICATIONS
  2681.  
  2682. If you have an application that you want to run in Full Screen then in
  2683. HOOK.DAT so define it by entering the number 1 OR 4 in the column following 
  2684. the key id, AltX 1  or CtrlX 4 if you want the session to be Full Screen 
  2685. OS/2 OR Full Screen DOS respectively. From the Define Hot Key Menu the 
  2686. choice is clear.
  2687.  
  2688. Doing it this way assigns the Task List Title the name Alt-X or Ctl-X as
  2689. when loaded with the 0 option or 7 option. This means that the program is 
  2690. loaded Full Screen with the assigned Key Combination and if the program is 
  2691. already loaded, it can be switched to from the desktop by hitting its 
  2692. Hot-Key and if you are in the full screen mode, then pressing Ctrl-Esc 
  2693. brings up the Task List, which is a PM and the hot keys are active from 
  2694. there. This means that switching to Full Screen applications from the 
  2695. Desktop is the same as if they are windowed and switching back from Full 
  2696. Screen applications takes only 1 more Key Combination to switch to a 
  2697. Windowed Application. Similarly switching between Full Screen applications 
  2698. also takes only one more Keyboard action, the Ctrl-Esc to the Task List and 
  2699. then the use of the appropriate Hot-Key.
  2700.  
  2701.                           Screen Resolution
  2702.  
  2703. I have tested this program with screen resolutions of 640x480, 800x600
  2704. and 1024x768. In all three cases, ON MY System, all of the menus and
  2705. screens of HOOK are contained within the display screen correctly. HOOK
  2706. determines the screen resolution and adjusts its parameters accordingly.
  2707. Nonethelss some users have reported  problems with Menu integrity. Please
  2708. let me know if such exists on your system and if so what Video Board
  2709. and Monitor you are using. It is not that I can necessarily do anything
  2710. about it, but at least I can build up some data base in this area.
  2711.  
  2712.  
  2713. ABOUT THIS PROGRAM
  2714.  
  2715. HOOK vs. 5.60
  2716.  
  2717. This program and its accompanying DLLs was written in 32 bit Assembler.
  2718. The assembler used was Microsoft's MASM 6.00b and the OS/2 2.1 ToolKit
  2719. and its resources were used for compiling the INF file and the resource
  2720. files used.
  2721.  
  2722. If you have any interest in obtaining the source code and how to
  2723. assemble it, contact me via compuserve or at the address indicated
  2724. below. The program is FreeWare.
  2725.  
  2726.            Vs: 5.60.                 Sat  08-24-96
  2727.  
  2728.            Morton F. Kaplon
  2729.            1047 Johnston Drive
  2730.            Bethlehem PA 18017
  2731.  
  2732.            Voice: 610/758-9686    FAX: 610-758-9262
  2733.  
  2734.            CompuServe ID 73457,437
  2735.            E-Mail        emkay@fast.net
  2736.  
  2737.  
  2738.  
  2739.