home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / hook4301.zip / hook.txt < prev    next >
Text File  |  1996-02-12  |  115KB  |  2,278 lines

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