>>>> Contents of README.1st <<<< Information for HOOK vs 5.70 Tue 09-17-96 ------------------------------- INSTALLATION ------------------------------- From the directory containing the UNZIPPED files as the current directory type INSTALL and follow the directions and prompts from the Install Program. !! DO NOT install this into the same directory as any current version !! !! of HOOK. If you wish to retain the same name for the directory in !! !! which to Install, then move the current content to another directory. !! !! or rename the directory containing the earlier the current version. !! !!! AFTER HOOK is installed DO NOT rename the directory or any of the !!! !!! files relating to HOOK. When HOOK is installed it copies the name !!! !!! of the directory into which it is installed into HOOK.EXE and that !!! !!! information is required when HOOK is loaded, !!! I believe this version has all the problems with switching to loaded Hot Key programs fixed as well as the maintenance of the files HOOK.INI and HOOK.HKY. It has modified the way PM type programs are handled and includes new HOOK window messages and display behavior. When a Program is FIRST loaded by HOOK, the HOOK window will FLASH and display the Message HOOK BUSY until the critical part of the program load has occured. When the HOOK window stops flashing then it is safe to active another HotKey. The time for a Program to Load is highly dependent on the particular program and happen almost instantaneously or take seconds to complete. This version of HOOK attempts to serialize the loading of programs so that a new program load is not started until the current program being loaded has completed it load. >>> Built In HotKey to Inactivate HotKeys now is Shift-Ctrl-SpaceBar <<< >>> This is a change from Shift-Alt-5 which is no longer used <<< NB:There is now an option to Turn Off the Beeps accompanying the Flashing. HOOK Window when a Program is Loaded. There are some very few programs that do not install into the Task List. Since HOOK uses the Task List for its information on Program Loading and Unloading these cause a problem. That is handled by the use of a Timer. When any HOOK program is loaded, a Timer is started that turns off the Flashing Window and resets some other crucial parameters of HOOK so that it will continue to function normally. This time delay is set at 10 seconds. I have included a section in HOOK.INF (HOOK.TXT) on how HOOK works. This is a significantly Updated Version and you should read the documentation before Installing or Using It. Significant Capabilities have been added to HOOK. New A mapping of the HotKey Combinations has been made to create an 5.7 option to the Shift-Alt-X,Shift-Ctl-X,Alt-Ctl-X that is just a two key combination Key-X. The purpose is to by pass conflicts with program defined combinations using Alt-X or Ctl-X keys. The current combinations are still in effect but the new Key-X combinations can be used in place of them. The mappings are: Shift-Alt-X -> ScrollLock-X Shift-Ctl-X -> NumLock-X Alt-Ctl-X -> Pause-X Keyboard handling is done so that if the alternates are used, their state (and the LED state) is maintained. >> This modification makes the use of the Alt-Pause,Shift-Pause >> unnecessary but it is still supported. However, the addition of >> the Pause Key as a Hot-Key makes its use with Alt/Shift cumbersome >> requiring multiple entries to access it. Its use is not recommended. NEW A PASTE mode has been added to HOOK. The built in HotKey 5.7 Shift-Alt-SpaceBat toggles this mode On/Off. When the PASTE Mode is Active the HOOK oowindow Flashes and the Title Bar is changed to display PASTE. When ON the HotKeys (user defined) PASTE user defined text into the current window. The text to paste is defined by the User using the same HotKey sequences as for the normal Hot-Key operation and activated by the HotKey assigned to that Text. The Text string, is in a formatted form using <...> to allow the inclusion of various Control Keys (in general these are recognized only in PM windows) and the total string length is up to 296 Characters. Each string may have a Description attached to it and these descriptions can be displayed using the same key combinations (in the Paste Mode) as used for the Normal HotKeys. NEW HOOK will read in a formatted Text File that allows Control type 5.5 keys to be pasted into PM windows(that accept text). The same type of formatting can also be assigned to a HotKey if it is preceeded by a ':'. The formatting is of the form where KeyName is usually the label on the Keyboard. Included also is a and a option formatted as and . There is also a comment option formatted as <* Comment> Reading in the formatted Text File is initiated by Shift-Alt-F5 which brings up a FileDialog Window to obtain the name of the file. See the OnLine Help File Under HOT-KEY Assignments-Fixed by Program NEW An ICON to start HOOK will now be installed by the INSTALL Program. 5.0 REDESIGN of Access to HotKey Menu for Assigning HotKey Shift-Alt-F3 now brings up Window Prompting User to Type In Hot-Key to Assign/Edit and identifies HotKeys ASSIGN HotKey to Window on DeskTop (OS/2 PM and TEXT only) Assigned to Hot-Key Shift-Alt-F9 CLOSE All Program Started by HOOK - Assigned to Shift-Ctrl-Del This option will close all programs that were loaded from a HOOK Hot Key. CLOSE Active Program - Assigned to Alt-Ctrl-End This will close the Active Window (PM,OS/2 or DOS) PASS STARTUP HOT KEY to HOOK to Call After Loaded When Hook is loaded a HotKey to Execute by HOOK can be passed to HOOK on the Command Line to Execute after HOOK is loaded. PASTE TEXT STRINGS INTO Windows Text Strings may be assigned to HotKeys and when that HotKey is struck the assigned text is pasted into the window with the Keyboard Focus. There are two options for this. One pastes very rapidly and the other with a very small time delay between characters om the string. EXECUTE SEQUENCES OF HOT Keys This is a macro like capability that does not require recording. A sequence of HotKeys may be assigned to a single HotKey and all will be executed when that HotKey is struck. BE sure and read the documentation on this. SCHEDULE Hot Keys Option This is a completely new addition which allows the user to Schedule any assigned Hot Key for execution at a specified time (hh:mm AM or PM) on any, all or selected days of the week. At the specified time the program is executed just as if the Hot Key key strokes had been entered at the Keyboard. IN ADDITION PLEASE NOTE THE FOLLOWING CHANGES FROM EARLIER VERSIONS MACRO RECORDING now omits WM_MOUSEMOVE messages. This speeds up playback and loses nothing since those messages just display the mouse pointer moving from one location to another. The actions at the end of that are unchanged. MACRO PLAYBACK started by Shift-Ctrl-Ins within HOOK may be terminated by pressing the Esc Key. PLAYKEYS.EXE IS NO LONGER INCLUDED. The format of this program is not compatible with the new installation of HOOK BUT more importantly, its task has been superseded by the PASTE TEXT STRINGS INTO Windows option. HOOKQDLL.DLL HAS BEEN CHANGED. The change is required to accomodate a new configuration parameter. See below for those additions. HOOK.INI HAS BEEN CHANGED. In order to save the additional configuration parameters HOOK.INI has increased in size. In addition some reserve bytes have been added for potential future use. HOOK DISPLAY WINDOW Now displays messages when HOOK is loading/switching programs. Message indicates that a program is being loaded or if switching the technique used for Switching .i.e.SwitchList Handle. (the Task List title is no longer used by HOOK). USER ASSIGNABLE HOT-KEYS ADDED Two new user assignable Hot Keys have been added. This results in HOOK.HKY increasing in size by 2*278 bytes. They are 2-Char Hot-Keys Alt-Pause and Shift-Pause. In HOOK.DAT they may entered as Pse-A and Pse-S for assignment. DEFINE HOT KEYS ENTRY SCREEN This has been significantly changed to display current assignments of a Hot Key for Editing. HOOK.HKY BINARY FILE STORING HOY-KEY INFORMATION. Automatically read in when HOOK loaded and saved when HOOK unloaded. If you want to read this, use a HEX editor. BE sure and use the new one and use HOOK.DAT to read old settings back in. HOT-KEY TASK MODIFIED:Shift-Alt-UpArrow Shift-Alt-UpArrow no longer reads in HOOK.DAT. It now reads in HOOK.HKY from disk. NEW BUILT IN HOT-KEY:Shift-Ctl-Del This Hot-Key will CLOSE ALL Programs Started using HOOK. It DOES NOT close HOOK. This is a quick way to clean the Desk Top. NEW BUILT IN HOT-KEY:Shift-Ctl-UpArrow HOOK.DAT is now read in by Shift-Ctl-UpArrow. In addition HOOK.DAT is NOT automatically read in when HOOK is loaded but may be read in as indicated above. Any assignments in HOOK.DAT will overwrite those currently in effect. NEW BUILT IN HOT-KEY:Alt-Ctrl-Esc In this version of HOOK, when HOOK is loaded the 3-Key sequence Ctrl-Alt-Del that is used for rebooting is disabled (by using a DosDevIOCtl Command). In its place this Hot-Key will display a message asking "Do You Really want to REBOOT ?" and informing you that if the answer is Yes, it will re-enable Ctl-Alt-Del BUT that no HOOK files will be saved. I have included this option because the Built in Hot-Keys Shift-Alt-End and Shift-Alt-Del may sometimes be inadvertenlty hit as Ctrl-Alt-Del ( I have one it on some occasions) and this then will not allow that to happen and any attempt to reboot will give you a warning message. NB. DISABLING Ctl-Alt-Del also DISABLES Alt-Home which in a DOS window allow switching between a DOS window and DOS Full Screen. Some problems may have occured with using OBJOPEN or PLAYBACK because of some inconsistencies in Command Line formatting between the 4OS2.EXE COMMAND PROCESSOR (which is what I use) and CMD.EXE (the default from IBM). These have now been fixed. NEW CONFIGURATION OPTIONS in Shift-Alt-F2 ACTIVATED MENU. BEEP accompanying Flashing Window when Program Loaded An option is included to turn this OFF or ON(default) Message Display KeyPad Use Options An additional option to toggle OFF/ON the BEEP when HOOK is loaded. New Menu Option for DLL Toggle OFF/ON how HOOKQDLL treats WM_CHAR messages. Currently WM_CHAR messages indicating a Hot-Key entered from KeyBoard are NOT PASSED on to System Message Queue. This option allows that behavior to be changed. Display Scheduled Hot Keys This lists on the screen the Hot Keys that are currently scheduled and the specifics of the Schedule for that Hot Key. (see above for that new option) This version is backward compatible with earlier versions except as noted above with respect to the files HOOKQDLL.DLL, HOOK.INI and HOOK.HKY . The INSTALL program has been modified to copy the readme.1st file to the target directory as well as the two DLL files. The DLL files are now no longer in \OS2\DLL but in the directory specified as the target directory to hold the HOOK files. The only REQUIREMENT for LIBPATH is that the first entry should be ".;" , i.e. the default directory. The Install program will now accept any valid directory name sequence up to 60 characters (including the drive specificaton) in length. Users booting OS/2 from a logical drive and with multiple versions existing should no longer have any problems. Just be sure that the active CONFIG.SYS has in its LIBPATH command ".;" as the first entry. All of these aspects and many more are detailed in the either of the two documenting files below. The two files HOOK.TXT and HOOK.INF contain the same information but HOOK.TXT is an ASCII text file and can be displayed with any Text Editor, List command or the DOS type command. HOOK.INF is an OS/2 PM file and can be viewed with the OS/2 view.exe program. That program is by default in the \os2 directory on the drive on which OS/2 is installed and \OS2 is almost certainly in the Path listing. To view HOOK.INF with VIEW just enter from an OS/2 command line where the default directory has HOOK.INF View hook. Either file contains instructions on Installation of HOOK as well as details about its use. If you want to use the assignments in an existing HOOK.DAT file, after this new version is installed, copy that file to the directory holding HOOK.EXE. When HOOK is loaded use Shift-Ctrl-UpArrow to read in that file. Then use Shift-Alt-DnArrow to save the assignments just readin into HOOK.HKY. Thu 06-06-96 Morton F. Kaplon >>>> END - Contents of REAME.1st - END <<<< Contents of HOOK57.ZIP FileName Description of File DOSERDLL.DLL Dynamic Load MOdule - For DOS API Error Messages HOOKQDLL.DLL Dynamic Load Module - intercepts system message queue (Updated) HOOK.DAT Sample Optional data file for hot-key assignments - read by HOOK.EXE HOOK.EXE Executable File - Executes According to Key Combinations Struck HOOK.INI Binary file read by HOOK; has configuration data for HOOK. HOOK.INF INF file displayed by VIEW.EXE - has Help/Information for HOOK HOOK.HKY Binary File Maintained by HOOK - has Hot Key Assignments HOOK.PST Binary File Maintained by HOOK - has PASTE Assignments HOOK.SKD Binary File Maintained by HOOK - has Hot Key Schedule Assignments HOOK.TXT ASCII File with instructions on installing and using HOOK INSTALL.EXE Complete Install of HOOK including target drive and directory. KEYBD.ICO Icon Bitmap for a KeyBoard OBJOPEN.EXE Program that opens Folders from Command Line OBJOPEN.DOC Document File for OBJOPEN.EXE PLAYBACK.EXE PlaysBack Hook created Macros from Command Line PLAYBAKF.EXE PlaysBack Hook created Macros from Command Line FASTER PLAYBACK.DOC Document File for PLAYBACK.EXE and PLAYBAKF.EXE README.1ST Readme File with brief listing of changes in Vs. 5.60 TASKLIST.EXE Displays Total Content of Switch Control Structure THUNKER.DLL DLL Needed for TASKLIST.EXE - User Should Copy to \os2\dll The INSTALL program copies the 8 files hook.* listed above, the two DLL files and README.1st to the Directory and Drive specified by you at Install Time and then establishes an ICON for HOOK on the desktop. The 5 files listed below it are special programs and their documentation files. These carry out specific tasks. You should copy them to a directory of your choice (which could of course be the directory you install HOOK into). The file TASKLIST.EXE displays the content of the Switch List Control structure maintained by OS/2.Since it displays data for programs that have had the Not Visible Flag set in the structure, it will contain more listings than the Task List displayed by Ctrl-Esc. For it to be used the file THUNKER.DLL must be in the \os2\dll directory. The user should copy it to that directory. Install.EXE copies the 7 files named HOOK, the two DLL files and Readme.1st to X:\HOOKDir\ where X: is the drive ID entered into the Install Window and HOOKdir is the directory name entered (C:HOOK is default). X:\HOOKdir can be up to 60 characters in length. HOOK.EXE can be started from an OS/2 command Line as X:\Hookdir\hook where X and HOOKdir are as defined above. An additional requirmeent is that the LIBPATH statement in CONFIG.SYS must have ".;" as the first entry in it. This should be the default setting but check it nonetheless. Some users have multiple versions of OS/2 and in some cases may BOOT one of these from a Logical drive. In that case you must be sure that the CONFIG.SYS file used on the boot drive has ".;" as the first entry in the LIBPATH statement. AN OVERALL VIEW ------------------- What HOOK does and How HOOK Works ----------------------- HOOK is a program that has two major functions. HOTKEY FUNCTION:In this role, when a certain combination of Keystrokes is entered at the Keyboard, HOOK either starts a program associated (by the user via a Screen Dialogue) with that Keystroke combination OR if that program was already started by HOOK, it Switches to it to make that the active program. HOOK will open or switch to a Full Screen program from the Desktop but will not switch back from the FullScreen to the DeskTop. The user must activate the Task List (Ctrl-Esc) to return to the DeskTop from Full Screen for HOOK to be effective. The HotKeys are of two types: 1-Set by the HOOK program to effect specified tasks - these are not available to the user for assignment. 2-Assignable by the user to open/switch to any of the following types of programs: OS/2 VioType Programs Windowed or FullScreen* (text type) OS/2 PM Programs. Inherently windowed. OS/2 CMD Programs. These must be passed as a command line parameter to the OS/2 command processor. DOS Programs Windowed or FullScreen*. Includes COM EXE and BAT files, and Windows 3.x * Note the comment in the preceeding paragraph. HOOK will not Switch Back directly from FullScreen. The user must use Ctrl-Esc to get to the DeskTop from which HOOK is active or for DOS programs Alt-Home will window a Full Screen program (if it is compatible with a Windowed Session). The Keystroke combinations HOOK offers for Assignment of Programs are: (X is 0,1,.....8,9 A,B,....Y,Z) Shift-Alt-X denoted as Alt-X 36 Key combinations Shift-Ctl-X denoted as Ctl-X 36 Key combinations Alt-Ctl-X denoted as Qac-X 36 Key combinations Alt-Pause denoted as Pse-A 1 Key combination Shift-Pause denoted as Pse-S 1 Key combination Total Assignable 110 Key combinations NEW Because many programs do not filter the KeyStroke combinations 5.7 completely, they will respond to a Shift-Alt-X or Shift-Ctrl-X or Ctrl-Alt-X if any of the Alt-X or Ctrl-X combinations hs been pressed and thus the HotKey actions are intercepted and have to be entered again or hit twice in successions. To bypass this a set of alternate Single Key mappings from the Key-Key-X combination has been made such that none of the Keys are Alt or Ctrl Keys. The mappings are: Shift-Alt-X -> ScrollLock-X Shift-Ctl-X -> NumLock-X Alt-Ctl-X -> Pause-X NB: Alt-Pause and Shift-Pause have not been mapped. Keyboard handling is done so that if the alternates are used, their shift state and corresponding LED state is maintained. MACRO FUNCTION:In this role, HOOK starts recording ALL Keystroke, mouse and other activity producing messages and storing it in memory. When the user indicates that recording should stop HOOK presents the User with the option of storing the data recorded in 2 files representing the data in both Binary and ASCII format; the user assigns the file prefix and the extensionns are HEX/MAC for the binary/ASCII version. A given Macro can be replayed by HOOK by loading it from Disk to Memory or by using the included program PLAYBACK.EXE to playback the Macro by using it as PLAYBACK MACRONAM.HEX either from the Command Line or assigned to a Hot Key. To accomplish these functions HOOK utilizes 2 execution units, HOOK.EXE and HOOKQDLL.DLL referred to hereafter as HOOK and DLL respectively and uses several additional files to store configuration options, the actual user defined HotKey assignments and the macro files. HOOK.INI Binary format,stores user selected configuration parameters. HOOK.HKY Binary format, stores HotKey assignments made by the user from an on Screen Dialog. HOOK.DAT ASCII file, the user may use to enter HotKey assignments. It exists for compatibility with earlier versions. UsrName.HEX Binary format, stores data for a given Macro. UsrName.MAC ASCII format, stores data for a given Macro. The DLL is the equivalent of a DOS TSR program. When HOOK is started, it loads the DLL into memory and the two functions indicated above are carrried out cooperatively by the DLL and HOOK. When HOOK is exited, the DLL is unloaded from memory. The DLL is primarily a DETECTION unit whose principal function is to monitor the system message queue and inform HOOK when certain parameters are detected in a message. HOOK is primarily an Execution unit carrying out tasks based on what the DLL detected. The DLL and HOOK communicate with each other in several ways. 1-Way Paths: from DLL -> HOOK using the System Message Queue. 2-Way Paths: a-Shared memory space between the DLL and HOOK; b-HOOK calls functions residing in the DLL passing parameters to it in registers; the DLL returns values to HOOK in registers. ------------------------------ The DLL ------------------------------- DLL means Dynamic Link Library. In this application it can be thought of as the equivalent of a TSR in DOS. That is, it is loaded into memory by HOOK when the program is called and remains there until HOOK is exited, when it is unloaded. The DLL intercepts the system message Queue. HOTKEY FUNCTION:Is the default action. It examines messages with MessageID = WM_CHAR, since it is these that carry all information about Keyboard activity and messages with MessageID = 2F43H (an undocumented message described below). MessageID = WM_CHAR For each WM_CHAR message the DLL determines the following: Did there exist any of the following Key Stroke Combinations : Shft-Alt-X X is any key with a valid Scan code Shft-Ctl-X X is any key with a valid Scan code Alt-Ctl-X X is any key with a valid Scan code Alt-Pause Shft-Pause If any of those combinations is detected the DLL Posts a Message to HOOK using MessageID = WM_USER+300H, with parameters indicating which of the 5 Key combinations was struck; the parameters are defined as: --HotKey-- --MessageID- Parm1 ----Parm2------------ Shft-Alt-X WM_USER+300H 0000H ScanCode of X Key Shft-Ctl-X WM_USER+300H 0001H ScanCode of X Key Alt-Ctl-X WM_USER+300H 0002H ScanCode of X Key Alt-Pause WM_USER+300H 0003H ScanCode of Pause Key Shft-Pause WM_USER+300H 0103H ScanCode of Pause Key It then DISCARDS that WM_CHAR message. That is, it does not pass it along to the next Queue. The reason for this is that almost all programs use Hot Key combinations of the form Alt-X and/or Ctl-X . IF the WM_CHAR messages for the Hot Key combinations above were passed along to the message queue, then every time you entered a Hot Key combination, if the active window at that time used Alt-X or Ctl-X of the Hot Key Combination, it would be activated for that program in addition to activating the HotKey and that is not a very comfortable environment in which to function. Nonetheless I have included a Configuration Option which allows the user to Toggle DISCARDING the WM_CHAR messages OFF/ON, the default being DISCARD ON. MessageID = 2F43H For each 2F43H message the DLL detects it Posts a Message to HOOK with parameters as follows: ----Parm1--- ----Parm2---- -------Parm3------ -------Parm4------ HOOK_Handle WM_USER+305H Parm3 of 2F43H msg Parm4 of 2F43H msg 2F43H is an undocumented message (in existence and unchanged since vs. 2.0) that is sent to the TaskList / SwitchList. (I use the names interchangeably). It informs the TaskList when a Program is activated and added to the TaskList and when a Program is closed and removed from the TaskList. In each case the TaskList Handle of the program is contained in Parm4 of the message and the value in Parm3 indicates what the action is for the program associated with that TaskList Handle. The relevant parameters used by HOOK are: MessageID TargetWindow --Parm3-- --Parm4-- -------Meaning-------- 2F43H TaskList 00000001H TLHandle Program Added to TaskList 2F43H TaskList 00010001H TLHandle Program Added to TaskList 2F43H TaskList 00000002H TLHandle Issued after above Case 2F43H TaskList 00000003H TLHandle Program Removed from TaskList These messages are used by HOOK to obtain the TaskList and Window Handles of newly loaded programs. When the message indicating Program Removal from the TaskList is received the asssociated HotKey has both its TaskList Handle and Window Handle set to NULL. MACRO FUNCTION:Initiated and concluded by signal from HOOK. In addition to WM_CHAR messages it stores all messages but WM_TIMER and WM_MOUSEMOVE in the shared Memory area. (These are so numerous that they would quickly exhaust that space and their omission does not effect MactoPlayback.) MACRO RECORDING:Initiated when the DLL receives a signal from HOOK. HOOK ON sends that signal when the User hits the Keystroke combination Shift-Ctl-LeftArrow or Shift-Ctl-[. All messages in the system message queue except those with ID WM_TIMER and ID WM_MOUSEMOV Eare stored in the Common memory area by the DLL. When the PlayBack is done from within HOOK it may be aborted by pressing the Esc Key when Playback is displayed in the HOOK Window. MACRO Recording:Concluded when the DLL receives a signal from HOOK. HOOK OFF sends that signal when the User hits the Keystroke combination Shift-Ctl-RightArrow or Shift-Ctl-]. The DLL returns to HOOK the number of Messages recorded. ------------------------------ HOOK ------------------------------- Initialization:When HOOK is loaded it performs the following tasks: 1-Creates a Message Queue for HOOK. 2-Sets directory for HOOK as that where HOOK.EXE is. (this is why LIBPATH must have "." as first directory so that the DLL's are accessable) 3-Loads a DLL for Error messages from OS/2 DOS functions 4-Reads in from Disk HOOK.HKY to Memory and initializes certain parameters in the assignments therein. 5-Reads in HOOK.INI and sets configuration accordingly. 6-Determines the Command Processor used for OS/2 7-Creates a Thread for displaying messages from HOOK primarily related to Startup and Macros. 8-Creates Thread for displaying HOOK window containing Date and Time and used for Messages relating primarily to HotKey related activities. 9-Loads HOOKQDLL.DLL and establishes link with it. 10-Establishes the Input HOOK for the DLL. 11-Exchanges Initialization data with DLL. 12-Starts a Timer (times out every 1/2 second) that is used for loading HotKey Programs that have been queued. 13-Starts the Message Loop for the Queue used by HOOK. HOTKEY FUNCTION:Programs are loaded using the DOS API DosStartSession with parameters as defined by the user in an On Screen Menu when the Hotkey assignment is made and stored in a resident data structure. Active programs are switched to using properties of the SwitchList Control Structure maintained by OS/2. Since HOOK makes intensive use of the TaskList it is worth making some comments about the SwitchList. -- BEGIN : SwitchList Control Structure and Task List -- OS/2 for PM maintains a Data Structure called the Switch List Control Structure. There is an entry in this data structure for each ACTIVE program amd Icom-Views (Open Folders) started by OS/2 PM. This data structure's visible representation is in the so called Task List, the listing of running programs and Icon-Views, presented when Ctrl-Esc is struck. However not all active programs are visible in the Task List becauuse one of the parameters a PM program may set is it's Visibility in the Task List. Many of the programs used by OS/2 are not Visible in the task list and thus not listed. (Included in the HOOK ZIP file is a program TASKLIST.EXE that displays a listing of ALL the programs in that structure, Visible or Not in the Task List ). When a program is started it is added to the Switch List Control Structure and a variety of parameters relating to it are set. One of these of particular interest to HOOK is the Switch List Entry Handle. This handle can be used to Switch To the program if it is in the Switch List Control Structure and make it the active program. Another parameter is the program Title that appears in the Task List. This title can be Set by the program and if no title is set by the program, OS/2 uses the Name of the EXE program as the Title in the Task List Listing. For ALL but PM type programs, once the Title is set when the program is loaded, it cannot be changed. PM type programs can change the Title listing at any time and many do. PM programs may take a significant time to load, and the Task List Title entered for them is not finalized into the Switch List Control Structure until loading is complete. In fact some programs may change the title several times and even dynamically. The Switch List Handles assigned by OS/2 are re-usable. The Switch List handle assigned by OS/2 to a program becomes available for re-assignment when that program is unloaded just as Window Handles are. OS/2 uses an undocumented message MessageID = 2F43H whose parameters were indicated earlier. This message informs the Task List when a program is first loaded and when it is Unloaded and contains its Task List Handle as one of its parameters. HOOK uses that information to set values in its record base for Hot Keys as indicated in a table listed above. -- END : SwitchList Control Structure and Task List -- HOOK maintains a Data Structure containing the information entered by the user when assigning Programs to HotKeys as well as Information it obtains relative to an entry from other sources. This structure consists of 110 records, each 278 bytes long. This structure is saved in HOOK.HKY. The records for Shft-Alt-X Shft-Ctl-X Alt-Ctl-X are in consecutive blocks of 36 records. The last two records are Alt-Pause and Shift-Pause in that order. The three main blocks of data are in order Shft-Alt-X Shft-Ctl-X Alt-Ctl-X. These four record blocks are referred to respectively as SAX, SCX, ACX and ALP. The elements of the Structure with their offsets into each record are: Ofst S_TotDescr 000 I ;Address for DosStartSession S_HKID 004 U ;The Hot Key X character *S_Desc 006 U ;Program Description S_ProcID 056 I ;ProcessID from Task List S_AppType 060 P ;From DosQuery AppTyhpe using Prog Name and Path S_FlagByte0 061 ;Reserved S_FlagByte1 062 ;Reserved S_FlagByte2 063 ;Reserved S_Program 064 U ;Program Name and Path S_CmdLine 128 U ;Command Line Parms S_WorkDir 192 U ;Working directory S_WHandle 252 I :Window Handle of Loaded Program S_TLHandle 256 I ;TaskList Handle Obtained When Prog 1st Loaded S_Winx 260 U ;X coord Lower Left WindowCorner in Pixels S_Winy 262 U ;Y coord Lower Left WindowCorner in Pixels S_WinWidth 264 U ;Width of Window in Pixels S_WinHeight 266 U ;Height of Window in Pixels S_SessType 268 U ;Session type S_ProgFlag 270 P ;0/'P' No/Yes Program entered S_HKSTatus 271 P ;Hot Key STatus 0/'A' = Not/Yes Assigned S_DescFlag 272 P ;0=No Desc,'D'/'3'= Desc|TaskListTitle for PM apps S_WDirFlag 273 P ;'Z' if Working Dir entered else 0 S_CLFlag 274 P ;'C' if Command Line entered else 0 275 ;Reserved 276 ;Carriage Return Line Feed Record Terminator U means Entered by User P means determined by HOOK from parameters entered I means internal Information obtained by HOOK Event Sequence When HOOK receives a message with ID = WM_USER+300H that messeage is from the DLL and has information on the parameters of a HotKey combination. HOOK first determines if the HotKey combination is one of those used by HOOK itself and if so carries out that predefined action and awaits another message. IF the HotKey combination is not one of those used by HOOK it may be a User Assignable one. HOOK uses the Parm1 (HotKey Type) and Parm2 (KB ScanCode) to determine the offset into the record structure for that Hot Key. It checks a FLag set in the data structure (S_ProgFlag) for that HotKey to see if an assignment has been made to it. If not it does nothing, otherwise it obtains the Switch List Handle and does the following in sequence&colon. 0-If the handle is zero it Loads the program assigned to the Hot Key and Sets a FLag indicating a Program is being Loaded by DosStartSession and the HOOK window will display the message "KB¨ Prog_Load". In addition the HOOK Window will flash and ring an alarm and continue until the program load is beyond the critical point related to receiving the MessageID = 2F43H with Parm2 = 2. The next interaction HOOK has with this Hot Key is that drtailed in 2 or 3 below. IF another HotKey is activated while the Active Flag is Set, the parameters of that HotKey are placed into a FIFO List. This list is interrogated every 1/2 second when the Timer Times Out and if there is a program to be loaded and the Busy Flag is not set, it is loaded. 1-Uses the SwitchList Handle to try to switch to the program. If successful a message will be displayed in the top line of the HOOK window "KB¨ TL-Handle". 2-If the SwitchList Handle does not switch to the program it displays an error message. Here the user should then check the HotKey assignments. When any Program is loaded and added to the Task List the system sends the Task List window the message with MessageID = 2F43H with parameters as noted earlier. IF the Flag indicating HOOK loaded a program is SET, and HOOK receives a message WM_USER + 305H indicating a Program has been added to the Task List, it copies the Switch List handle obtained in Parm4 of the message to the appropriate location in the Hot Key Data Stucture. 3-Program Loaded by HOOK is unloaded. HOOK receives the message with ID WM_USER+305H with Parm3 = 3 and Parm4 = SwitchListHandle of Program Just closed. HOOK goes thru HotKey records seeking Match with Handle and sets it and its Window Handle both to NULL. MACRO FUNCTION: Initiated when User Presses Shft-Ctl-LeftArrow or Start Recording Shft-Ctl-[. The user is first presented with a message informing him/her to move to the desired starting position using either the Cursor or Mouse. When the user Presses Enter in response to the Message, then a Message "KB¨ Recording" appears in the HOOK window on the top line indicating that recording is active. HOOK calls the DLL passing parameters to it and indicating that Macro recording should begin. Keystroke and Mouse activity are recorded until Shft-Ctl-RightArrow or Shft-Ctl-] is pressed. Ending the recording is an effective way of aborting it. End Recording When either of the HotKeys indicating Macro Recording should stop is received, the "KB¨ Recording" is removed from the HOOK window and HOOK calls the DLL passing parameters to it that indicate Stop Recording and receiving back the number of records recorded. A dialogue box is then presented the User requesting input for the file name prefix for the Macro just recorded. The user may choose not to save the Macro to file by selecting the Cancel option or may enter a File Name. Two files, containing the binary record (UserName.HEX) and the ASCII record (UesrName.MAC) of the Macro are then saved to disk in the directory chosen (default is the directory containing HOOK). At the end of the file dialogue a Message is displayed on the screen informing the user that the Macro (still in memory) may be played back by the HotKey combination Shft-Ctl-Ins and that the Playback mayh be aborted with the ESc Key.. Saving a Macro A macro remains in memory until a new Macro is recorded. in Memory If the user decides that he would like to save that Macro, the Hot Key combination Shft-Ctl-PgDn brings up a file dialogue as above to obtain informaiton on the File Name and directory in which to store it. Play Back Macro The built in HotKey Shft-Ctl-PgUp presents the user with a file dialog box to obtain the Name of the Macro file to Load Into memory. When the user chooses the Macro and presses the OK button on the dialogue Box, the Macro is loaded into memory. It is then played back by pressing the HotKey combination Shft-Ctl-Ins. While the playback occurs the message "KB¨ PlayBack" appears in the HOOK window. When the Playback is concluded, the message is removed from the window. The PlayBack may be aborted by Pressing the ESc Key. A Macro may also be played back using the executable file PLAYBACK.EXE or PLAYBAKF.EXE by passing the name of the macro binary file (MACRONAME.HEX) to it as a command line parameter. This combination may be assigned to a Hot Key for convenience. PLAYBAKF.EXE plays back faster than PLAYBACK.EXE does. --------------------- Content of the saved Macro Files --------------------- For each message saved by the DLL a record is created that contains the following information (in binary) stored in memory. Each of the parameters below is 32 bits (4 bytes) long and is the content of each Message in the Queue. Handle MessageID m sgParam1 msgParam2 msgTime X_ScreenP Y_ScreenP For UserName.HEX the content of the memory is saved in binary form to that disk file. For UserName.MAC each of the parameters above is converted to a Hex Number and stored as ########H. Additionally the Handle for that record is used as an input to the OS/2 API WinQuerySwitchList to get the Title (if any) from OS/2's Task List and is stored as a 24 byte string. Each message is separated from the following by a Carriage Return and Line Feed. The file contains as its first record the HEADER string: WinHandle MessageID msgParam1 msgParam2 msgTime X_ScreenP Y_ScrrenP TaskListName Handle is the Handle of the Window to whom the message is directed. MessageID defines the type of information (WM_CHAR,WM_COMMAND,etc ) msgParam1 and msgParam2 are data uniquely associated with that MessageID. msgTime is the time of the message. X_ScreenP and Y_ScreenP are the coordinates of the Pointer. ------------------------- How the PlayBack is Done ------------------------- To play back a Macro, the Macro file in HEX format (UserName.HEX) is read into memory and each message is interrogated by HOOK. What HOOK does is to take action on a limited nuymber of Message ID's. It does look at and attempt to interpret the following message IDs WM_CHAR WM_BUTTON1DOWN WM_BUTTON1UP WM_BUTTON1DBLCLK WM_BUTTON1CLICK WM_BUTTON1MOTIONSTART WM_BUTTON1MOTIONEND WM_BUTTON2DOWN WM_BUTTON2UP WM_BUTTON2DBLCLK WM_BUTTON2CLICK WM_BUTTON2MOTIONSTART WM_BUTTON2MOTIONEND WM_BEGINDRAG WM_ENDDRAG WM_OPEN WM_CLOSE WM_SYSCOMMAND WM_COMMAND WM_CONTROL WM_PAINT WM_TRANSLATEACCEL (This is rather flaky and very program dependent) WM_USER+300h --- ID for HOOK.EXE as target WM_SIZE WM_MINMAXFRAME TaskList This is the ID for the Task List determined dynamically. The problem is that many messages associated with Mouse movements depend on the location of the Mouse Pointer on the screen. These coordinates are in the recorded message data, but unless the DeskTop is set up exactly as it was when the message was recorded, their playback can be meaningless or misleading. In a similar vein, other messages such as WM_PAINT, WM_COMMAND, WM_SYSCOMMAND,WM_CLOSE,WM_CONTROL, WM_CLOSE have in the recorded message a specific WindowHandle as their target. But those window handles are not valid at this juncture so in interpreting the Macro I have just used the window with the focus. To do a really totally faithful job of Macro Recording and Playback one would have to, at the time of Recording, obtain the precise state of the system with respect to Programs loaded, and what is on the Desktop and reinstate that condition before playing back the Macro. I have not done that. But what I have done, does do a reasonable job with respecvt to WM_CHAR messages and some mouse actions. Why HOOK ?? HOOK was designed to alleviate the need to clear up the Desktop of OS/2 in order to obtain access to Icons to load programs and to facilitate switching from one active program to another. I found myself all too frequently having to to minimize some of my active programs in order to access the Desktop to load another program that was required. Additionally I wanted a quicker way of switching to another program than using Alt-Esc to move through active programs until I came to the desired one or by accessing the Task List to select the program or my using the Mouse to activate an Icon. Conceptually then, HOOK is akin to a DOS TSR. Whereas a DOS TSR is resident in Memory, HOOK works through DLLs, DOSERDLL and HOOKQDLL.DLL are loaded into memory when HOOK is loaded. DOSERDLL contains information for display if an Error occurs using an OS/2 DOS function. HOOKQDLL monitors the message queue for WM_CHAR messages, the equivalent of a TSR hooking the KB interrupt. WM_CHAR messages contain information on Keyboard activity and HOOKQDLL, depending on the Keyboard Activity sends messages to HOOK which executes according to the key combinations struck as defined in the file HOOK.HKY (new feature) which is maintained by HOOK.EXE. OS/2 itself by default assigns a variety of actions to Keystrokes. For instance F1 brings up HELP, Alt-F4 closes an active program, Ctrl-Esc brings up the Task List,Alt-Esc and Tab-Esc switch to the next program in the Task List, Alt-F7 moves a Window, Alt-F8 resizes, Alt-F10 maximizes, Alt-F5 restores and so on. In addition each program as a rule has its own set of dedicated Keystrokes to accomplish certain actions. Editors and Word Processors are very rich in such keystroke assignments. If a Hot-Key type program is to be useful, it should be as unobtrusive as possible and not interfere with programmatic hot-keys. I originally chose the triple key combination of Shift-Alt-X, Shift-Ctrl-X, where X can be 0,....9,A,B,.....Y,Z (case insensitive) for the Hot-Keys since in my experience to date, they had been almost unused. I also used those combinations with X being keys on the Key_Pads for Hard Coded actions relating to tasks involving HOOK itself. A configuration option exists that allows these hard coded assignments to be active only on the Numeric Key Pad. I have recently added the combination Alt-Ctrl-X to the Hot Keys increasing the capability by 50 %. And at the request of a user I added Alt-Pause, and at the same time added Shift-Pause as well. These may be assigned from either the Hot Key Define Menu or from HOOK.DAT. Now for some CAVEATS. There is at least ONE Program, VIEWALL.EXE of IBMs that does not let itself be installed in the TaskList. Why I do not know. I asked IBM and got their usual non-response. Anyhow, HOOK uses the TaskList intensely. The consequence of this program not using the TaskList is that you cannot switch to it by a HotKey after it is loaded, even though you can still load it with a HotKey. If use assign it to a HotKey, use your mouse to switch to it. >>>> Since this type of program is not in the Task List the techniques >>>> HOOK uses to turn the Flashing window OFF after a program is loaded >>>> do not work. Thus, when any HOOK program is loaded, a Timer is >>>> started that turns off the Flashing Window and resets some other >>>> crucial parameters of HOOK so that it will continue to function >>>> normally. This time delay is set at 10 seconds. There are some editors, the E.EXE OS/2 Editor for instance as well as the Editors built into many Compiler programs that use the Shift-Ctrl-Cursor_Pad keys very heavily for Block activities and thus I have added a Toggle key, Shift-Alt-5(On KeyPad) to HOOK that allows the user to temporarily toggle its trapping actions OFF so that the total Keyboard is available to the user. That same Toggle key then re-activates HOOK so that Hot-Key switching is back ON. PM programs also make use of Mnemonic Keys when the Menu bar is active (menus accessible with Alt-F, Alt-H, etc.). If a PM program uses mnemonic keys ( Help is an example) and you have H assigned as a HOT-Key, say Shift-Alt-H, then when you press Shift-Alt-H you will get the Menu Key Option for H, but pressing it a second time will bring up the Hot-Key assignment. In addition PM programs may also use assignments to Ctrl-X (as the E edior does for X=F for the Find option). If you have a Hot-Key assigned to Shift-Ctrl-X, where X is a program defined key, then the Hot-Key will bring up that option. A quick repeat of the Hot-Key will produce its desired action. These kinds of problems do not bother non-PM programs (ASCII text editors) and similar TEXT based Non-PM programs. I have built into HOOK a configuraton option (changeable while HOOK is in use) that can modify the above behavior. HOOK works through HOOKQDLL.DLL which intercepts the message queue and looks at each WM_CHAR message. Each message has a flag that indicates whether it is a PM type application or not and the DLL tests that flag. The configuraiton option allows the DLL to take an action depending on whether that flag is set for a given WM_CHAR message. The default option is to ignore the flag. This has the consequence that the program entering key strokes and thus using Hot-Keys has the KB focus and will activate any PM program user defined keys - as noted this can be quickly overridden by entering the Hot-Key again. But one can change that behavior with the DLL configuration option so that when a PM program has the KB focus, when a Hot-Key sequence is hit, it switches the focus to the DeskTop so that the PM program's defined keys are not accessed. Whether this is desireable or not depends on the particular PM program, how one uses it and so forth. In general I find the default setting of no resetting the focus the most useful, since re-entering the hot-key if required is not very onerous and you do not lose access to a programs built in keystrokes. End of CAVEATS There are two classes of hot-key assignments in HOOK. One class is hard coded and cannot be changed by the user. The other is under the user's control and allows the user to assign specific actions to a given key combination. That assignment may be done in one of two ways. The default (new) is by filling in parameters into a menu activated by Shift-Alt-F3. An optional method is to fill in a (user maintained) ASCII Text file (HOOK.DAT) which HOOK can read in on command activated by Shift-Alt-UpArrow when HOOK is active. This method is that user by earlier versions of HOOK prior to 3.01. These two methods are not exclusive and both may be used. The HOOK.DAT file is backwardly compatible with earlier versions of HOOK. The Hot Keys assigned by filling in the parameters into the Menu are saved in the file named HOOK.HKY which is re-read every time HOOK is loaded. Any assignments read in from HOOK.DAT are saved in the same structure saved by HOOK.HKY and are thus not lost when HOOK is exited. Current values may be saved by using the Alt-Shift-DnArrow to read them to HOOK.HKY HOOK has an additional feature. It can (with some limitations) save a sequence of Keyboard and Mouse Actions so that they may be replayed. I have found this useful for establishing certain DESKTOP environments that I use repeatedly. These "Macros" may be saved to Disk and restored From disk to memory for replay. When saved to disk, the user is prompted for the name under which to save the macro and two files are saved in X:.\HOOKdir. One with the extension HEX which is the file that can be played back when loaded into memory and the other a Text file with extension MAC. The latter contains the information in the Message queue for the sequence of commands that are in the Macro. These macros may also be played back from the command line (or assigned to Hot Keys to play them back) by using PLAYBACK.EXE or PLAYBAKF.EXE for general macros, In that case the DLL setting should correspond to the Active Window having the KB focus, otherwise your playback does not go where you intend it to. PLAYBAKF.EXE is essentially the same as PLAYBACK.EXE except that the macro is played back FASTER. An alternate option in the Define Menu fir HotKeys allows the user to assign sequences of HotKeys (or sequences of ASCII Hcaracters) to a Hot Key and play them back. This replaces some use of Macro Recoridng and Playing them back if what is being recorded is Just Text entry or ASCII characterss to paste onto the screen. See later for more details. HOOK communicates with the user via a small window on the desktop. I have found it useful to have this window contain the current date and time as well as to display messages from the program. The window appears as: ÚÄÄÂÄÄÄÄÄÄÄÄÄÂÄÄ¿ ³ г KB HOOK ³ ܳ ÃÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄ´ ³ KB¨ hh:mm:ss ³ ³ Day mm-dd-yy ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ The time is updated every second and the updates are maintained via a separate thread started from HOOK . There is an option in the On Line configuration to make the Window Invisible as well as options to change its size, location and colors (if Visible).The default location is the lower right corner. Messages are displayed on the first line of the display temporarily overwriting the current time. When HOOK is carrying out some special activity it will display a message in the Window reflecting that on the first line of the widow. When a Program is being switched to it will display a message indicating the method HOOK used to do that; either the Switch List Handle (TL-Handle) or the Switch List Title (TL-Title). When a Program is being loaded it will display the message Prog_Load in the HOOK window. It will also Flash that window and sound a few initial beeps. During that time No Other pprogram should be loaded. When the window stops flashing it safe to load another program. The delay depends on the type of program being loaded. Hardly any at all for non-PM program but can take longer for som ePM programs. INSTALLING THE HOOK To use the Install.exe program, be sure it is in the same directory as the rest of the files included in the ZIP file. If you are installing from a floppy, make the floppy drive the active directory and be sure that OS/2 is active. You should do this from an OS/2 window. IF a PREVIOUS VERSION IS ACTIVE, UNLOAD it before installing this version. INSTALL.EXE installs this version in a directory named \HOOKdir on a drive (X:) both modifiable by the user in a Menu Entry Field. The Install program allows a directory path name (including the drive specification) up to a total of 60 characters in length and the specification may include sub- directories so long as the length limit is obeyed. To use INSTALL just enter INSTALL from the command line where the current directory contains INSTALL,EXE and the other unzipped files. The files will be copied to the appropriate directory and if it does not exist it will be created. What INSTALL.EXE does in detail: A menu is presented with an input field of C:\hook prompting the user to accept the parameters as given or to edit them to meet his/her requirements. A directory specificaton, including sub directories, up to 60 characters long may be entered. If the director(ies) do not exist they will be created. IF X:\HOOK\ (or the drive:\name chosen) does not exist, it will be created. If HOOK.DAT exists in X:\HOOKdir\ it will be renamed to HOOK.DAX. IF HOOK.HKY exists in X:\HOOKdir\ it will be renamed to HOOK.HKX. HOOK.DAT, HOOK.EXE, HOOK.HKY, HOOK.INF, HOOK.INI, HOOK.TXT, DOSERDLL.Dll, HOOKQDLL.DLL and README.1ST will be copied to X:\HOOKdir\. !!! FOR USERS OF VERSIONS PREVIOUS TO 3.01 !!! You should delete any current version of HOOKQDLL.DLL before beginning the installation of this version. This new version is backward compatible with HOOK.DAT BUT its primary, and the DEFAULT method of entering HOT Key Assignments is by the use of an ON SCREEN menu system, activated by Alt-Shift-F3. If you prefer to use the former method of assigning Hot Keys (i.e. via HOOK.DAT) its assignments must now be manually read in after HOOK is loaded by using the Hot-Key Shift-Ctl-UpArrow (changed from prevous versions) or making a selection from the Menu (activated by Alt-Shift-F2). After completing the installation you may substitute your current HOOK???.DAT file by copying it to X:\HOOKdir and renaming it as HOOK.DAT. BUT before doing that look at the header to the default DAT file which comments its structure for calling programs. Current DAT files can be used but there are enhancements that you may find useful. It would probably be wiser to just edit HOOK.DAT to reflect your current usage. STARTING HOOK Assume that HOOK is installed on drive X: in the directory HOOKdir. To start the program, from an OS/2 command line give the command X:\HOOKDir\HOOK or Start X:\HOOKDir\hook You could have this command in a CMD file as a means of starting HOOK or you could also have it in your STARTUP file. One of the new features is the ability to pass HOOK a parameter on the command line which specifies a HotKey to activate after HOOK is started. This is detailed later. CONFIGURING THE HOOK There are various configuration parameters for the program which are stored in the file HOOK.INI which is read in by the program when it is started and which remain in effect unless changed from the configuration menu. In addition HOOK.HKY which has the User Defined Hot-Key Assignments is also read in when the program is started . User Assignments may be modified when the program is active as may the other configuration options. Hot-Key Assignments are modified by using Shift-Alt-F3 to access the Hot-Keys Menu Screen to add new assignments, delete current assignments or edit(new) current assignments. Hot-Key Assignments may also be modified by altering HOOK.DAT and then re-reading it into memory using Shift-Ctl-UpArrow. The program window may be resized and relocated by using the Mouse Pointer at the window edges to change window dimensions, thus effectively resizing and relocating the window. Alternately the use may use the Move and Size options of the HOOK Window to make those chantges. In either case, the ability to save those changes for the next startup are among the configuration options for the program. These options for the program are available by placing the mouse pointer anywhere on the display window and pressing the right mouse button or by pressing the key combination Shift-Ctrl-5 or Shift-Alt-F2. Either brings up the menu displayed below: HOOK Version 5.60 Quit KeyBoard Hook Select Editor to use for DAT File Edit Edit HOOK.DAT File (Updates HOOK when Edit HOOK.DAT exited) (To UPDATE while Editing : Save File then Shift-Ctl-UpArrow ) Assign Hot Keys Read In HOOK.DAT assignments for Hot Keys Save Current Hot Key Assignments to HOOK.HKY Get HOOK.HKY Assignments for Hot Keys CoPy Active PM Task List Titles to Hot-Key Descriptions Change Colors Window Options Message Display and KeyPad Use Options DLL Option Set Window Focus for PM Programs DLL Option PASS/DONT_PASS HotKey Messages ON in Message Queue Display Scheduled Hot Keys Use Ctl-Alt-Del Option Explanations: Quit KeyBoard Hook Closes the program in an orderly fashion. Select Editor to use for DAT File Edit Allows user to enter the filespec of the editor to use for editing the DAT file or to change the filespec of the default editor (E.EXE) if it is not in X:\os2\. The editor selected is saved in HOOK.INI. Edit HOOK DAT File By default uses the E.EXE editor of OS/2. It is assumed that editor is located in C:\os2. The filesper may be changed using the option listed above. (Updating the EXE file occurs when the Editor Above is Closed) The DAT file is automatically re-read into the EXE file and the appropriate buffers updated when the Editor used to modify the DAT file is closed. If one does not use this option to modify the DAT file, then the EXE may also be dynamically updated with the Key combination Shift-Alt-UpArrow. Assign Hot Keys Activates the Define Hot-Keys Menu (same as Shift-Alt-F3) Read In HOOK.DAT assignments for Hot Keys Same as using Shift-Ctl-UpArrow to read in current HOOK.DAT File Save Current Hot Key Assignments to HOOK.HKY Saves all Current Hot-Key Assignments to disk in HOOK.HKY Get HOOK.HKY Assignments for Hot Keys Reads in HOOK.HKY from Disk. This will override all current assignments in place. This is same as Shift-Alt-UpArrow. CoPy Active PM Task List Titles to Hot-Key Descriptions Many PM programs modify the Task List Title established by HOOK when the program is loaded. HOOK uses the Task List title to switch to loaded programs. Using this option will copy the Task List title established by a PM program to the Description for that program maintained by HOOK. This enables HOOK to switch to that program if other methods fail. Change Colors Presents the user with a menu allowing the selection of Foreground and Background Colors from a group of 16 options Using Push Buttons. The changes are effected immediately and are saved in HOOK.INI. þF WHITE þB þF DARKGRAY þB þF BLACK þB þF DARKBLUE þB þF BLUE þB þF DARKRED þB þF RED þB þF DARKPINK þB þF PINK þB þF DARKGREEN þB þF GREEN þB þF DARKCYAN þB þF CYAN þB þF BROWN þB þF YELLOW þB þF PALEGRAY þB Default Foreground = Blue Default Background = White In the Menu the Actual Colors are displayed instead of the Text indicating the colors. Window Options Selecting the Window Options presents 8 push buttons in 3 separate group indicated below. Select Window Options ----- Comment ----- o Window Bottom Left o Window Bottom Center o Window Bottom Right Default o Use Current Win Size/Position o Window Visibile Default o Window Not Visible o Window NotJumpable Default o Window Jumpable The choices grouped together in each of the 3 groups are mutually exclusive and only one may be chosen. The first group of 4 offers selection for the placement of the HOOK information window ÚÄÄÂÄÄÄÄÄÄÄÄÄÂÄÄ¿ ³ г KB HOOK ³ ܳ ÃÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄ´ ³ KB¨ hh:mm:ss ³ ³ Day mm-dd-yy ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ The first three place the window at the bottom of the screen at one of the three locations indicated. The fourth choice is meant to be used if none of the first three are acceptable. The user may reposition and resize the window by using the pointer to drag the sides to new locations and to resize the window accordingly. Or one may use the Move/Size options of the HOOK window's menu to do the same. Hook may also be repositioned by putting making HOOK the active window and with the pointer in its window drage to the desired location. In either case, after it is positioned to your liking that selection will copy the data for the new window position to HOOK.INI and it will be used on starting up again. The second group of two is the option for the Visibility of the window. If Invisible is chosen, it is temporarily made visible to display any messages in the window. The last group sets the response to the Alt-Esc / Alt-TAb Key stroke actions. Not Jumpable means the window is not made active in response to those key strokes. Message Display and KeyPad Use Options When a program is loaded HOOK;s window will Flash and Optionally Beep several times. The default to Beep is ON. An option is give to set this to either ON or OFF. Hook may be unloaded (Shift-Alt-Del) or unloaded and OS/2 Closed down (Shift-Alt-End). The DEFAULT is to display a Message Box for either case asking if you want to continue. This may be changed to no Message Box display with this option. Some computers have 2 Sets of Key Pads . One has numeric keys and is referred to as the W(hite) pad and the other has cursor keys and is referred to as the G(rey) Pad. The DEFAULT configuration is to have both key pads respond to the Built In Hot-Key Assignments which use the Key Pad in conjunction with the Shift-Alt/Ctrl keys. That may be changed to use only the Numeric Key pad with this option. BEEP sounded when HOOK loaded. Some users have requested this option to turn Off/On the BEEP signal when HOOK is loaded. DLL Option Set Window Focus for PM Programs The DEFAULT configuration does not change the KB Focus of the program entering Hot-Keys. This means that if a PM program has defined Alt-X or Ctrl-X combinations and you enter a Hot-Key combination that has Alt-X or Ctrl-X in it, it will activate that built in option; repeating the Hot-Key will then activate its desired action, closing the program defined action. Retaining this setting also means that Keyboard Macros will be entered into the current window as it has the KB focus. The other option changes the KB focus from the window that had the focus to the DeskTop. This means that no repeat Hot-Keys need be entered, but also playback of KB macros does not work, nor does the user have access to the programs defined option keys. In general the DEFAULT option of Window retaining the KB focus is the most useful and flexible. DLL Option PASS/DONT_PASS HotKey Messages ON in Message Queue The default setting is for HOOKQDLL not to pass the WM_CHAR messages that contain the KeyStroke Combinations Shift-Alt-X Shift-Ctrl-X ALt-Ctrl-X Alt-Pause Ctrl-Pause where X is a valid Keyboard Scan Code, to the next Message Queue. This is because when a Shift-Alt-X for example, is activated, there is also activated an Alt-X and many programs have built in Hot-Keys sensitive to such assignments. If the message were not discarded, every time you used a Hot Key containing such a combination that the Program with the Keyboard Focus (Active Program) used, you would activate that also and it is a most uncomfortable environment to work in. It is recommended that if this gives a problem for some programs, then just temporarily deactivate HOOK with the Off/On toggle initiated by Shift-Ctl-SpaceBar. Display Scheduled Hot Keys This option will display a Screen listing ALL the Hot Keys which have been scheduled in the format (X means not scheduled that day and hh:mm aare the hour and minutes after the hour as Scheduled) : ------------- Comment ------------- * Alt-X hh:mm AM on S M T W T F S S-A-X scheduled AM on All days of week * Ctl-X hh:mm PM on X M X W T F X S-C-X scheduled PM on Mon,Wed,Thu,Fri * Qac-X hh:mm PM on X X X W X F X A-C-X scheduled PM on Wed,Fri Pse-A hh:mm AM on X X X X X F X Alt-Pause scheduled AM on,Fri Pse-S hh:mm PM on S X X X X X S Shft-Pause scheduled PM on Sun,Sat * X : 0,1,.....9,A,B,......Z The display option allows for the display of 44 Scheduled Hot Keys. Use Ctl-Alt-Del Option This option deals with the Alternate REBOOT Option. The default value is to USE the Alternate REBOOT Option. That is, the Ctl-Alt-Esc key REBOOTS the system. When this option is ON, the Ctl-Alt-Del key sequence is disabled. This menu option will offer the User the option to Turn OFF the implementation IF it is ON and to turn it ON if the implementation is OFF. Changes made from this Menu remain in effect thru the remainder of the session while HOOK is active. When the session is ended, via Shift-Alt-End or Shift-Alt-Del the current values of these parameters are saved in HOOK.INI and these are restored for use when the program is next loaded. SELECTING THE EDITOR FOR EDITING THE DAT FILE As noted the default editor used for editing the DAT file is the E.EXE editor that is included with OS/2. The assumption is made that this is located in C:\os2 where it is placed when installing OS/2 2.0 / 2.1 or WARP. If this editor is not satisfactory or the assumption is incorrect then use this option to enter the correct drive and directory for e.exe or the editor of your choice. REBOOT Option HOOK uses the DosDevIOCTL Keyboard category, function 56H to toggle the Alt-Ctrl-Del key combination OFF/On. The first time it is called it is toggled OFF, the next time ON,etc. I have found that I sometimes inadvertently hit the Alt-Ctrl-Del sequence and have no way to recover. HOOK toggles Alt-Ctrl-Del OFF when it is loaded and ON when it is Unloaded (Shift-Alt-Del). In this version the Alt-Ctl-Esc key is a built-in Hot Key that displays a message "Do You Really Want to REBOOT ?"and gives you a Yes - No choice. IF you choose YES, then Alt-Ctl-Del is Toggled ON and HOOK is exited without saving any HOOK files (in the spirit of REBOOTING). I have found that I sometimes inadvertently hit Alt-Ctl-Del when I meant to hit Alt-Shift-Del and so I installed this SAFEGUARD. NB. Toggling OFF the Ctl-Alt-Del sequence has a side effect. The Alt-Home key combination, which in a DOS session allows switching between a window and Full Screen, is DISABLED. HOT-KEY ASSIGNMENTS-FIXED BY PROGRAM The fixed key assignments are all related to the functioning of HOOK and with one exception use the Shift-Alt or Shift-Ctrl keys in combination with the Numeric or cursor pad (default option). HARD CODED ASSIGNMENTS Explanations Shft-Alt-? Display User Defined HotKeys for Shift-Alt-X ** Shft-Ctl-? Display User Defined HotKeys for Shift-Ctl-X ** Alt-Ctl-? Alt-(Ctl-X) / Pause Hot Key Assignments ** Shft-Alt-\ Display Prog Defined HotKeys (this listing) Shft-Ctl-Esc REBOOT Option Shft-Alt-Del Unload HOOK Shft-Alt-End Unload HOOK and ShutDown System Shft-Ctl-Del Close Progs Started by HOOK Alt-Ctl-End Close Active Program Alt-Ctl-Up/DnArrow DeActivate One/All HotKeys ! Shft-Alt-UpArrow Read HOOK.HKY into Memory Shft-Alt-DnArrow Save Current Hot Keys to HOOK.HKY Shft-Ctl-UpArrow Read HOOK.DAT into Memory Shft-Alt-Ins Open Small OS/2 Window Shft-Ctl-LeftArrow/[ Start Macro Recording Shft-Ctl-RghtArrow/] End Macro Recording and Save to Disk File Shft-Ctl-Ins PlayBack Macro Currently in Memory Shft-Ctl-PgDn Save Current Loaded Macro to DiskFile Shft-Ctl-PgUp Load Selected Macro from Disk to Memory Shft-Alt-F1 Activate On LIne Reference Window Shft-ALt-F2|Ctl-5 Activate PopUpMenu for Configuration Options Shft-Alt-F3 Activate Hot Key Assignment Menu Shft-Alt-F5 Select File to Paste to PM Program Shft-Alt-F9 Assign Hot Key to Active Window Shft-Ctl-SpaceBar Toggle Hot-Keys Off/On Shft-Alt-SpaceBar Toggle PASTE Mode Off/On Right Mouse Button(On HOOK Window) PopUpMenu for Configuration Options Press or to Exit * These options exist for use when recording macros in the E and EPM editors and similar ones which use Shift-Left|Right Cursor to Start and End copy and paste operations of text. **This display reflects the current Active Hot-Key assignments. If HOOK.DAT is read in with new assignments or new assignments are made from the Hot-Key Menu those are automatically reflected in this listing. No user intervention is required for these file displays (this is changed from earlier versions which required the user to create these displays) ! Deactivation means that the TaskList Handle (used for switching by HOtKeys) stored for a HotKey is set to NULL so that if this HotKey is Entered, a new seesion for the program assigned to that HotKey is started. This is useful if by inadvertance HOOK is closed. When HOOK is closed any other means than Shift-Alt-Del the current TaskListHandles are not saved so that when HOOK is restarted Programs loaded by HOOK do not have HotKeys actively assigned. This is a means of setting the Slate Clean (as it were) and one should closed those windows and reopen to have the full benefits of the HotKeys. It is also useful if you want to start a new session for a given Program. The HotKey will then be active for the new Session. Extended KeyStroke Insertion into PM Applications There are two ways of accessing this: 1-Assign to a HotKey using the HotKey menu. Enter the Coded Text into the Prgm. File Spec field with the first character entered the colon (&colon.). This is a signature required by HOOK. This does not supplant or replace the HotKey assignments preceeded by a '&colon.' or a '-'. Those and their formats are still valid. No other fields are required though the Description Field may be used. 2-Create an ASCII Text File (default is extension of TXT) containing the coded text and access the file via the BuiltInHotKey Shift-Alt-F5. The Target Window (a PM application) must be Active when Shift-Alt-F5 is executed. The user will be presented with a file dialog whose default is \Hookdir\*.txt on the drive where HOOK was installed and Hookdir is the name of the directory chosen for installation. Select the desired file and the content will be pasted into the Target Window. AT the conclusion a sound will be made and a message displayed saying that the File (and the file spec will be displayed) has completed processing. The next time Shift-Alt-F5 is called the default directory and file extension will be that of the file last selected. Keys will be coded as the appear on the keyboard with exceptions as noted. The Key Coding is NOT CASE SENSITIVE To display < enter as << To display > enter as >> ------ Actions Not Related to Keys inserts a delay of up to ###.### seconds = # secs = #.# secs = ##.## secs etc. spaces are ignored. ----- Comments (not pasted) are included as: <* any comment> ------Sound a Tone of frequency f for a duration of d milliseconds 300 cycles/sec for 1/2 second(500 Milliseconds) is ----- Single Keys ----- <------------- Comment -------------> X&colon.0..9,a..z,A,.Z,rest of Printable Ascii Escape Key Response Depemds on Target Window Tab Key BackSpace Key Alternate Key Response Depemds on Target Window Control Key Response Depemds on Target Window ShiftKey Response Depemds on Target Window Enter Key Space Bar Function Key X&colon.0---12 Response Depemds on Target Window ----- Cursor Pad Keys ---- Home Key End Key PgUp Key PgDn Key Up Arrow Key Down Arrow Key Left Arrow Key Right Arrow Key Insert Key Delete Key ------ Other Keys --------- PrintScreen Key Pause is essentially meaningless here - if followed by KeyInput then that is overridden at once. NB For TextFiles the embedded CarriageReturn LineFeed at the end of each line of text is ignored. To actually create that combination in pasting you must have the coding . Example&colon. This is a text file to paste 745407745472wait 1 01 <* A Comment>938498458277wait 2 02 03928<*Another Comment>3978475wait 3 03 745297392772wait 4 04 When pasted into a PM Editor such as the E.EXE or EPM.EXE editor it appears as&colon. 745407745472 wait 1 01 938498458277 wait 2 02 039283978475 wait 3 03 745297392772 wait 4 04 and the appropriate sounds would have been made at the start of lines 1 and 4 and the time delays would have occured at the locations where coded. An example of using a HotKey is as follows on Prgm File Spec &colon.if( ){} When that HotKey assignment is executed into a PM Editor and the cursor is at the left margin, it displays if( ) { } with the cursor appearing inside the (). If the cursor is not initially at the left margin, it wil appear as if( ) { } where the if( ) is positioned at the cursor location at the time of the call. I have found the pasting from a file useful for entering data into Spread Sheets or inserting canned text into editors/word processors. It is a program indepedent form of Macro for Text. HOT-KEY ASSIGNMENTS-USER DEFINED There are two methods that may be used to assign Hot-Keys. The first employs an On Screen Menu titled Define Hot-Keys This menu is activated by the Hot-Key Alt-Shift-F3 or by selecting the Assign Hot Keys choice from the User Menum Activated by Shift-Alt-F2. When either of these choices is made you are presented with the Screen Type in HotKey Combination for Assignment or Editing Shift-Alt-X Shift-Ctl-X Alt-Ctl-X Alt|Shift-Pause Where X = A,B..Z 0,1..9 OR to Abort When the Hot Key Menu Appears the HotKey selected will be displayed at the top of the Define Hot Keys Menu (below it is indicated as Shift-Alt(ScrlLock)-X) if you are in Normal Mode or if in PASTE Mode the HotKeys Assignment Menu PASTE Mode will appear for your input. The other method(for normal Hot-Keys only) is backward compatible with that used in earlier versions of HOOK. It involves filling in an entry in the text File HOOK.DAT that defines the Hot Key Assignment. This file is read into HOOK by using the Hot-Key - Shift-Alt-UpArrow (in earlier versions this was automatically read into HOOK when it was loaded). The Hot-Key assignments that are in place when HOOK is exited are automatically saved in the file HOOK.HKY and these are automatically read into HOOK when it is loaded. (There are options in the menu activated by Alt-Shift-F2 to save the current Hot-Keys to HOOK.HKY and to re-read HOOK.HKY into memory.) The active Hot-Key assignments are in a Record Format in HOOK.EXE, where there is a separate record for each of the possible Hot-Key Assignments. When HOOK.DAT is read into HOOK it fills out only those records for which a Hot-Key is assigned in HOOK.DAT. If an assignment exists it is over written. If HOOK.HKY is read into memory it completely overwrites the current records so that they are lost. If you want to maintain different sets of Hot-Key assignments then a given set should be Read Out to HOOK.HKY and that saved by renaming it. To read it back it would then have to be renamed back to HOOK.HKY. Alterately you could save different sets in a series of HOOK.DAT files (stored in a different directory) and copy the one you want to be active to the directory where HOOK.EXE is stored. THE DEFINE HOT-KEYS MENU SCREEN Assigning Hot Key : Shift-Alt(ScrlLock)-X Prgm. File Spec: [ ] CR Accepts Enter String to Paste as -|=xxxxxxxxx and SAVE NB the '-|=' is REQUIRED For <..> formatted Strings :xx<..>xxx and SAVE NB the ':' is REQUIRED o Shell Establishes o Full Screen OS/2 o Windowable(Vio) o Windowed (PM) o Full Screen DOS o Windowed DOS !! The Four Items Below are Optional !! Command Line:[ ] CR Accepts Working directory:[ ] CR Accepts Description:[ ] CR Accepts Window Loc/Size:[ ] As: xxx yyy wwww hhhh ] CR Accepts (in Pels) [( SAVE Hot Key Assignment )] [(SCHEDULE Hot Key Assignment)] [(CLEAR Selected Hot Key and EXIT)] [(CLEAR All Hot Keys and EXIT)] Cursor UP/Dn/Left/Right Keys Moves Within Groups SpaceBar or Left Mouse Button to Select Tab Key to Next Group Aborts [(EXIT)] {û} SCHEDULED The user Fills in the Hot Key Menu to assign a program to a Hot Key. The user MUST : Enter the program specification (just as in the Path Field in the OS/2 Settings Menu Select ONE of the Session Types (letting the Shell establish the type is a good safe choice). >>>> The validity of the Program Specification is checked and it >>>> must be a full file specification including drive and full >>>> path and the file extension of the executable file. >>>> For OS/2 this is EXE or COM (in some cases); CMD files >>>> passed on the command line as parameters to the >>>> Command Processor as the Program (fully specified) >>>> For DOS it is EXE or COM or BAT. >> OR << : Enter a Text String prefaced by either a '-'or an '=' that is to be inserted into the active window by the HotKey and then SAVE. The '-|=' is a REQUIRED identifier that this is a TEXT STRING and NOT a PROGRAM NAME. The TextString may contain spaces. No additional items are required for this option. This option does not work in a DOS Window. The distinction between using '-' or '=' is that the latter slows down the insertion of the string into the target window by inserting a very small time delay between each character. The reason for this is that some Queues are small in size and if you are inserting a long string very rapidly (as using the '-' option does) the entire string may not usually be displayed. The text string may also contain a sequence of HotKeys to execute. Hot Keys are identified as: \A|aX for the HotKey Shft-Alt-X \C|cX for the HotKey Shft-Ctl-X \Q|qX for the HotKey Alt-Ctl-X There are two additional options that are useful with the HotKeys. Each of these may be used up to 20 times in a given string assignment. The time delays inserted below in both cases are from the beginning of the invocation of the sequence. The sequence \rxxx where xxx is any integer creates a time delay of xxx seconds and then executes a Carriage Return into the window having the KB focus at that time. The sequence \dxxx followed by a HotKey designation (no spaces between \dxxx and the HotKey spec) executes that HotKey after a time dealy of xxx seconds from the initiation of the sequence. These are useful for sequences that may reauire a Carriage Return after loading an initial program (such as an Internet Access Programs) and then want to load another program that requires the first be active (such as an E Mail program). Since the first program may take many seconds to complete the time dealy before the execution of the second allows this to happen. For each of these a series of beeps is sounded when the time delay is met. The use of the Time Delay in the sequence is a means of serializing the sequence of events. The Window Flash is turned off for those HotKeys Activated using this format. The user may if desired enter a description for the text strings. Any other fields are ignored when the - option for the Program File Spec is chosen. NEW FEATURE The <...> coding format for Pasting TEXT into PM Programs. To USE this prefix the formatted string with ':' . Keys will be coded as the appear on the keyboard with exceptions as noted. The Key Coding is NOT CASE SENSITIVE To display < enter as << To display > enter as >> ------ Actions Not Related to Keys ----- inserts a delay of up to ###.### seconds = # secs = #.# secs = ##.## secs etc. spaces are ignored. ----- Comments (not pasted) are included as: <* any comment> ------Sound a Tone of frequency f for d milliseconds 300 cycles/sec for 1/2 second(500 Milliseconds) is ----- Single Keys ----- <------------ Comment ------------> X:0..9,a..z,A,.Z,rest of Printable Ascii Escape Key Response Depemds on Target Window Tab Key BackSpace Key Alternate Key Response Depemds on Target Window Control Key Response Depemds on Target Window ShiftKey Response Depemds on Target Window Enter Key Space Bar Function Keys Response Depemds on Target Window X:0---12 ----- Cursor Pad Keys ---- Home Key End Key PgUp Key PgDn Key Up Arrow Key Down Arrow Key Left Arrow Key Right Arrow Key Insert Key Delete Key ------ Other Keys --------- PrintScreen Key Pause is essentially meaningless here - if followed by KeyInput then that is overridden at once. An example of using a HotKey is as follows :if( ){} When that HotKey assignment is executed into a PM Editor and the cursor is at the left margin, it displays if( ) { } with the cursor appearing inside the (). If the cursor is not initially at the left margin, it wil appear as if( ) { } where the if( ) is positioned at the cursor location at the time of the call. End NEW FEATURE There are FOUR Optional Items that may be entered: Command Line: Parameters that need to be passed on the program command line. Working directory: The default directory from which the program is loaded. Many programs look for their initialization files in the default directory. The program checks the validity of this directory. Description: This is a description to be displayed on the Task List. For non-PM programs it will be displayed preceeded by the Hot-Key assigned (Alt-X / Ctl-X / Qac-X / Pse-X). If no description is entered here then the program will display the Program File Specification in place of the Description. For PM type programs, the program may modify the Task List Title so that this will not appear on the Task List but the name entered by the Program will replace the entry by HOOK. Some PM programs may change the TaskList Title. Window Locn/Size: If the program is windowed you may specify its Location and its Initial Size (both in Pels). xxx is the X location and yyy the Y location of the Lower Left Corner of the Window referenced with respect to 0,0 as the lower left corner of the Screen. wwww is the window width and hhhh its height. Pressing the SpaceBar when [[SAVE This Hot Key Assignment]] is HiLited saves this entry and enters it into a Record in the Hot Key data structure. The two Push buttons with CLEAR in them do as indicated. Be very careful using the [[CLEAR All Hot Keys]] for that will leave you with no Hot Keys active; if you push this by accident you can read back in your latest HOOK.HKY from the Menu activates by Alt-Shift-F2. If there exist data assigned to a Hot-Key combination, then when the user selects the Hot-Key Type and Hot-Key ID and presses Enter after the ID selection, the current assignments to that combination are copied into the respective Entry fields. IF that Hot Key has been SCHEDULED (see below) then a Check will appear in the box adjacent to SCHEDULED. These current assignments may be edited and saved. HOWEVER when current assignments exist, YOU MAY NOT CHANGE THE HOT KEY TYPE OR HOT KEY ID. The program will not allow those changes. If you want to have these assignments made to another Hot Key combination, you will have to enter them into that de novo and clear the assignments to the Key you no longer want to use. It is also possible to make this swtich of Hot Keys in the HOOK.DAT file and read it back in. After the Hot Key assignment has been SAVED or if there exists a valid Hot Key Assignment, the user may SCHEDULE this Hot Key for execution at a Set Time for SELECTED days of the week by selcting the push button SCHEDULE Hot Key Assignment this will activate the following Menu for the user to enter data into. SCHEDULE EXECUTION OPTIONS MENU ================================= Each of the 110 Definable Hot Keys May be Scheduled to be Started as if the Hot Key were entered from the KeyBoard Select Hour to Run Program o AM o PM o 1 o 2 o 3 o 4 o 5 o 6 o 7 o 8 o 9 o 10 o 11 o 12 Minutes After Hour o 00 o 10 o 20 o 30 o 40 o 50 Select Day(s) of Week to Run Program { }Sun { }Mon { }Tue { }Wed { }Thu { }Fri { }Sat [(Unschedule This HotKey)] [(Unschedule All HotKeys)] [( Cancel )] [( Save and Exit )] A given Hot Key mayh be scheduled for execution for any, selected, or all days of the Week but ONLY for one time on a given day. If you wish to have the same program executed at different times on a given day then you should assign that program to Another Hot Key and Schedule that Hot Key for another time. THE SCHEDULE DATA STRUCTURE The data structure for savoing the SCHEDULE assignments consists of 110 records (one for each Hot Key), each16 bytes long, termionated with a CR LF. The definition of a record is. ;---- offsets from start of structure Hook38 SKHour equ 0 ; 0,1,2,.12 Hour of Day on AM PM basis SKMinute equ 1 ; 0,...59 Minutes Past Hour SKDay equ 2 ; a 1 in a day position indicates it is chosen SKHotKey equ 9 ; Hot Key ID Same as from DLL SKScanCode equ 10 ; Scan Code of Hot Key SKAMPM equ 11 ; AM/PM = 0/1 ; equ 12 ; 2 bytes reserved ; equ 14 ; CR LF Record separator LenSchedule equ 16 ;has same number records as numrecs PASTING TEXT and HOT-KEY SEQUENCES ================================== It is possible to assign a Text String to be pasted into the Window having the Keyboard Focus or to assign a Sequence of HotKeys to be activated to ANOTHER Hot-Key. This assignment is done in the Define Hot Keys Menu. The user first must: Select a HotKey for the assignment. In the Prgm. File Spec. field the first entry must be a "-" or a "=" character. This is how the program identifies the entry as a PASTE sequence rather than as an executable program. OPTIONALLY the user may make an entry in the Description Field. If no entry is made here, the entry in the Prgm. File Spec. field is displayed when the option to display the descriptions is used. All other entries are ignored. <<<<< PURE TEXT STRINGS >>>>> If a pure text string is entered, e.g. -This is a pure Text String or =This is a pure Text String and assigned to the Hot Key, say Shift-Ctrl-A, then when Shift-Ctrl-A is pressed the string will be posted to the Window having the Keyboard Focus as a series of WM_CHAR messages, each message holding one of the characters in the string. If the Window having the Keyboard Focus does not have a message queue or if that message queue does not interpret the WM_CHAR messages, nothing will appear. Any ASCII character, even those created by using Alt-##, where # is a key on the numerical key pad will be posted. How and if they are interpreted depends on the target Window. For example, if you have an OS/2 command window as the target and post a message with the escape character (27 or ) in it then the command line interprets that as aborting the command line and no member of the string after it will appear. If you assign -dir ( = Alt-13 = ascii 13 = Carriage Return) to a Hot Key and activate it when an OS/2 Command window has the focus it will do the dir command. In general including such control characters will lead to nothing because of the interpretation problem but there are some special cases, as those noted above, where something will occur. <<<<< HOT KEY SEQUENCES >>>>> The text string may also contain a sequence of HotKeys to execute. Hot Keys are entered in the string as: \A|aX for the HotKey Shft-Alt-X \C|cX for the HotKey Shft-Ctl-X \Q|qX for the HotKey Alt-Ctl-X There are two additional options that are useful with the HotKeys. Each of these may be used up to ten times in a given assignment sequence. Each of these options inserts a time delay from the beginning of the activation of the sequence. The sequence \rxxx where xxx is any integer inserts a time delay of xxx seconds from the activation of the Hot Key and then executes a Carriage Return into the Window with the Keyboard Focus The sequence \dxxx followed by a HotKey designation (no spaces between \dxxx and the HotKey spec) inserts a time delay of xxx seconds from the activation of the HotKey before executing the designated HotKey. These are useful for seuqences that may reauire a Carriage Return after loading an initial program (such as an Internet Access Programs) and then want to load another program that requires the first be active (such as an E Mail program). Since the first program may take many seconds to complete the time delay before the execution of the second allows this to happen. For each of these a series of beeps is sounded when the time delay is met. These time delays can certainly be system dependent since how long it takes a given program to load will depend on that as well as perhaps other factors. It may be useful to give some examples that I use myself. I have assigned Loading my Internet Access Program to Alt-Ctrl-J. When this program is loaded it does not dial until a CR is made. The program takes a few seconds to load since it is done by a CMD file that has to turn off my fax software to free u the modem. What I want to do first after that is to see if there is any e mail and for that I use my PM_Mail program which is assined to the HotKey Alt-Ctrl-e . It must be loaded before the modem dials or after the Internet Connect is made or there is an error. It is is loaded after the internet connect is made, it automatically gets any waiting e mail so I would like it to load that way. My internet connect takes about 60 seconds so I need to wait that time after the CR on the Internet program. Thus my assignment for this, in my case to Shift-Ctrl-4 is -\qj\r6\d65\qe the \qj\r6 loads the Internet Access Program and does the CR 6 seconds later that starts the connect. the\d65\d\qe loads the PM Mail program assigned to Alt-ctrl-e after a 65 second delay (FROM THE BEGINNING). This allows for my system sufficient time for the connect to be made. It is important to note that the sequence of message postings are not serialized like DOS programming and there is no guarantee of the order. The time delays for a CR and for executing one HotKey commence from the beginning of the Paste HotKey activation. If the above sequence -\qj\r6\d65\qe were changed to add another HotKey at the end, such as -\qj\r6\d65\qe\aw where in my case Shift-Alt-w is the HotKey to activate the program displaying the SWAPPER.DAT information, then when the sequence is activated, the first program to appear loaded would be the last one, since it loads the fastest and has no time dealy restriction. Another example ( a simple one) that I use is one that loads a command window (HotKey Shift-Alt-1), another command window (HOt Key Shift-Alt-2) and an Editor (Shift-Alt-v). The string sequence is: -\a1\a2\av In general there is no practical use for intermixing Hot Keys and Text due to the serialization problem. USING SHIFT-ALT-F9 TO ASSIGN A HOTKEY TO ACTIVE PROGRAM This method, which is applicable only to OS/2 PM or Windowed Text applications, allows the user to assign a HotKey to a running program. (It cannot be used to Assign Opening a Folder to a HotKey) Pressing Shift-Alt-F9 brings up a Screen which asks the user if he/she wants to assign a HotKey to a user Selected Program. If the response is Yes then another Screen is presented that directs the user to Make the Target Program Active and then Press Shift-Alt-F9 again OR to abort with Shift-Ctrl-Esc. If the user continues with the Assignment by Pressing Shift-Alt-F9 after the target program is made active, another screen is presented displaying the HotKey options (or again Shift-Ctrl-Esc to abort). Tf the user continues by typing in a HotKey to assign, then a check is done to see if that HotKey is currently assigned and if so, that Information is presented and an option given to Continue or Abort. If Continue is chosen the assignment is made. The description that is entered is the Name of the EXE file for the program. That can be altered or command line options by using Shift-Alt-F3 to call up the more elaborate menu for editing the parameters of the HotKey. USER DEFINED DATA FORMAT In HOOK.DAT User defined hot-key assignments may also be made in the text file HOOK.DAT which is in the directory X:\HOOK\ . The default file loaded by INSTALL has a series of comments in it that describe the format of making key assignments and there are a number of assignments made in that file as examples. The user can delete them, reassign them or whatever. That file is reproduced below. Please Note that when HOOK is active, any changes to HOOK.DAT may be made active by pressing Shift-Ctlr-UpArrow. IF the EDIT option was chosen from the Pop Up Menu the changes automatically are read into HOOK.EXE when the Editor is exited. Either choice re-reads this file into the Hot Key Record Structure. If a Hot Key exists that is defined in HOOK,DAT, it is overwritten, otherwise current Hot Keys are not disturbed and any Hot Keys defined in HOOK.DAT not in the Hot Key record structure are added to it. Displayed below is the content of HOOK.DAT supplied for you initially. ***************** Beginning of File HOOK.DAT ***************** ;; HOOK.DAT Key Assignment file for HOOK.EXE Thu 07-06-95 ;; ;; This file MUST be located in the directory X:\HOOK???? ;; where X and ???? were chosen by the user at install time ;; ;; NB the actuating Key strokes are Shift-Alt-X, Shift-Ctrl-X, Alt-Ctrl-X ;; ;; <<<<<<<<<<<<<<<<<<<<<<< The format is as follows >>>>>>>>>>>>>>>>>>>>>> ;; ;; A ";" indicates a comment and text from there to end of line is ignored ;; ;; Blank Lines are not allowed - place at least one ";" on any line ;; ;; There must be at least 1 space between each field and the next field. ;; ;; The first field in a line is either A#, C# or Q# indicating an assignment to ;; Shift-Alt-#, Shift-Ctrl-# or Alt-Ctrl-# where # is 0,1,2,3,4,5,6,7,8,9 or ;; AX, CX, QX indicating assignment to to Shift-Alt-X, Shift-Ctrl-X, Alt-Ctrl-X ;; where X is any letter from a .. z. ;; ;; NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW NEW ;; To assign Alt-Pause or Shift-Pause the first field is either ;; PA for Alt-Pause or PS for Shift-Pause ;; ;; No distinction exists between LowerCase or UpperCase. ;; ;; The next field is optional - it allows the user to include a descriptive ;; text (up to 20 characters long) to describe the program. It will appear ;; in the Task List after the Alt|Ctl|Qac-X Hot Key indicator ;; The text to be included must be between @-------@ as ;; @Fox Pro 2.0@ ;; ;; The next set of (4) fields are collectively optional and allow the user ;; the ability to set the location and size of the Window. ;; They are entered as x|X### y|Y### w|W### h|H### ;; where x|X y|Y w|W h|H denote the coordinates of the lower left corner ;; of the window and w|W / h|H denotes the Width / Height of the window. ;; All sizes are given in PELS so that a set of values OK for one screen ;; resolution will appear differently for another. ;; x0 y0 w300 h400 will create a window located at the lower left corner ;; of the Screen whose size is 300 pels wide and 400 pels high. ;; ;; The next field has the following options. ;; ;; 9 means that the key will not be recognized. This can be accomplishied ;; as well by commenting that assignment out with "; ;; ;Ad means that Shift-Alt-D is not assigned ;; Ad 9 a 0 means that Shift-Alt-D is not assigned ;; the 9 must be followed by any letter a space and "0" ;; ;; OR just omitting Ad from the text also means it is not assigned ;; ;; Otherwise the field has the following meaning ;; ;; 0 Allows the Shell to establish the session type - best as a rule ;; 1 Starts program as Full Session OS/2 ;; 2 Start Program in Windowed Session for programs using Base Video System ;; 3 Start Program in Windowed Session for programs using PM services ;; 4 Start Program in Full Screen DOS session ;; 7 Start Program in Windowed DOS session ;; ;; The next field is the file spec of the program to be executed and the ;; field after that is either a "0" indicating no command line parameters ;; or the command line parameters. If the command line parameters contain ;; any spaces the command line parameters must be contained within "". ;; ;; Ae 0 c:\os2\e.exe c:config.sys ; loads the system editor included in OS/2 ;; to edit c:config.sys and assigns this ;; command to Shift-Alt-e ;; ;; Ae @Edit Config.sys@0 c:\os2\e.exe c:config.sys ; loads the system editor included in OS/2 ;; to edit c:config.sys and assigns this ;; command to Shift-Alt-e displays description ;; "Edit Config.sys" in Task List ;; ;; Generically speaking the format below assigns programfilespec to Shift-Alt-x ;; ;; Ax 0 programfilespec "program command line" ;if there are command line parms ;; ;; Ax 0 programfilespec 0 ;if no command line parms ;; ;; The programfilespec must contain the extension .COM / .EXE / .BAT ;; BAT files can be loaded just like EXE files but CMD files must be ;; passed as strings to the Command Processor. If the command processor ;; is CMD.EXE the the string must be "/C X:\dirname\fname.CMD". ;; The 4os2 command processor does not require the /C parameter. ;; ;; HOOK uses the DosStartSession Function of the OS/2 API to load programs. ;; It is documented on page 2-345 of the Control Program Functions Manual. ;; ;; DosStartSession does not like to load a CMD file directly so they must be ;; loaded with a command processor as ;; ;; A5 0 c:\os2\cmd.exe "/C abcdef.cmd" ; abcdef.CMD loaded by OS/2 command processor ;; ;; The 4os2 command processor does not require the /C parameter ;; A5 0 c:\4os2path\4os2.exe abcdef.cmd ; abcdef.CMD loaded by 4OS2 command processor ;; ;; To assign a program to a key follow the examples/rules above ;; ;; If you edit this file while HOOK is Active, press Shft-Alt-UpArrow ;; to re-read this file in and redefine the Active Set of Keys ;; ;; !!IF this file is edited from the HOOK Menu, it is automatically re-read!! ;; ;; In the Task List Shift-Alt-Key assignments are identified as Alt-X ;; In the Task List Shift-Ctl-Key assignments are identified as Ctl-X ;; In the Task List Alt-Ctrl-Key assignments are identified as Qac-X ;; ;; Please Note that As is assigned to Search and Replace Applet which may ;; not be valid for other than vs.2.1 and Cw for Windows is valid only for ;; OS/2 2.0/2.1 not for WARP!! ;; Q3 @3:OS/2 Command@ 0 c:\os2\cmd.exe 0 ;OS/2 window using OS/2 Command Processor A1 @1:OS/2 Command@ 0 c:\os2\cmd.exe 0 ;OS/2 window using OS/2 Command Processor A2 @2:OS/2 Command@ 0 c:\os2\cmd.exe 0 ;OS/2 window using OS2 Command Processor A3 @3:OS/2 FScreen@ 1 c:\os2\cmd.exe 0 ;OS/2 Full Screen using OS/2 Command Processor A4 9 x 0 ;Key not assigned A5 9 x 0 ;Key not assigned A6 9 a 0 ;Key not assigned A7 9 x 0 ;Key not assigned A8 9 a 0 ;Key not assigned A9 9 a 0 ;Key not assigned A0 9 x 0 ;Key not assigned Aa 9 a 0 ;Key not assigned Ab 9 x 0 ;Key not assigned Ac 9 x 0 ;Key not assigned Ad 9 a 0 ;Key not assigned Ae @System E Editor@ 0 c:\os2\e.exe 0 ;OS/2 e.exe system editor Af 9 x 0 ;Key not assigned Ag 9 x 0 ;Key not assigned Ah 9 x 0 ;Key not assigned Ai 9 x 0 ;Key not assigned Aj 9 x 0 ;Key not assigned Ak 9 x 0 ;Key not assigned Al 9 x 0 ;Key not assigned Am 9 x 0 ;Key not assigned An 9 x 0 ;Key not assigned Ap 9 z 0 ;Key not assigned Aq 9 x 0 ;Key not assigned Ar 9 z 0 ;Key not assigned As @Search and Seek@ 0 c:\os2\apps\pmseek.exe 0 ;OS/2 Search and Scan Applet At 9 z 0 ;Key not assigned Au 9 z 0 ;Key not assigned Av 9 x 0 ;Key not assigned Aw 9 z 0 ;Key not assigned Ax 9 z 0 ;Key not assigned Ay 9 z 0 ;Key not assigned Az 9 z 0 ;Key not assigned C1 @1:DOS Command@ 7 c:\os2\mdos\command.com 0 ;DOS window using built in DOS C2 @2:DOS Command@ 7 c:\os2\mdos\command.com 0 ;DOS window using built in DOS C3 @3:DOS FScreen@ 4 c:\os2\mdos\command.com 0 ;Full Screen using built in DOS C4 9 a 0 ;Key not assigned C5 9 a 0 ;Key not assigned C6 9 a 0 ;Key not assigned C7 9 a 0 ;Key not assigned C8 9 a 0 ;Key not assigned C9 9 a 0 ;Key not assigned C0 9 a 0 ;Key not assigned Ca 9 a 0 ;Key not assigned Cb @QBasic@ 7 c:\os2\mdos\qbasic.exe 0 ;QBasic from dos in DOS window Cc 9 a 0 ;Key not assigned Cd 9 a 0 ;Key not assigned Ce 9 a 0 ;Key not assigned Cf 9 c 0 ;Key not assigned Cg 9 b 0 ;Key not assigned Ch 9 c 0 ;Key not assigned Ci 9 c 0 ;Key not assigned Cj 9 d 0 ;Key not assigned Ck 9 e 0 ;Key not assigned Cl 9 f 0 ;Key not assigned Cm 9 c 0 ;Key not assigned Cn 9 g 0 ;Key not assigned Co 9 h 0 ;Key not assigned Cp 9 c 0 ;Key not assigned Cq 9 c 0 ;Key not assigned Cr 9 i 0 ;Key not assigned Cs 9 j 0 ;Key not assigned Ct 9 k 0 ;Key not assigned Cu 9 l 0 ;Key not assigned Cv 9 m 0 ;Key not assigned Cw@Windows 3.1@ 4 c:\os2\mdos\winos2\win.com 0 ;OS/2 DOS Win 3.1 Full Screen Cx 9 o 0 ;Key not assigned Cy 9 p 0 ;Key not assigned Cz 9 q 0 ;Key not assigned Pa 9 q 0 ;Key not assigned Alt-Pause Ps 9 q 0 ;Key not assigned Shift-Pause <***************** End of File HOOK.DAT *****************> When programs are loaded by a Hot-Key their title appears in the Task List (actuated by Ctrl-Esc) according to the following rules. IF A TITLE WAS NOT ASSIGNED USING @ASSIGNED TITLE@ then If assigned to a Shift-Alt key combination it appears as Alt-X name_as_assigned_in_field_3 where X is key assigned If assigned to a Shift-Ctrl key combination it appears as Ctl-X name_as_assigned_in_field_3 where X is key assigned If assigned to a Alt-Ctrl key combination it appears as Qac-X name_as_assigned_in_field_3 where X is key assigned In each case the string "name_as_assigned_in_field_3" contains up to a total of 24 characters from the filespec of the program to be loaded appended to "Alt-X ",to "Ctl-X " or to "Qac-X ". The reason for this is two fold. Most importantly it is because the program uses the Task List titles to determine if a program is currently active when that hot-key combination is struck and it switches to the running program. Secondly in the Task List it serves as a convenient reminder of the current hot-key assignments. The examples below reflect the Task List Title for some of the assignments above in the sample DAT file. IF THEY DID NOT INCLUDE AN ASSIGNED TITLE IN @.......@ Alt-E c:\os2\e.exe ;OS/2 e.exe system editor Alt-S c:\os2\apps\pmseek.exe ;the pmseek program Ctl-W c:\os2\mdos\winos2\win.c ;Win 3.1 (note the "om" missing) Ctl-3 c:\os2\mdos\command.com ;DOS window Please note that if the Alt-E assignment had been made as Ae 0 C:\OS2\e.exe 0 ;OS/2 e.exe system editor then its Task List title would appear as Alt-E C:\OS2\e.exe 0 IF the program had a title assigned between @ASSIGNED TITLE@ then that text would appear after the Alt-X or Ctl-X in the Task List. Programs not loaded by HOOK hot-keys will have their Task List titles reflect how the program is written. PM programs may have their Task List title reflect either the Program Name or the title that appears in their Window when loaded. In some cases the title bar is updated dynamically. The hot-keys Shift-Alt-/ ,Shift-Ctl-/ and Alt-Ctl-/ display on the screen a listing of the Hot-Key assignments in HOOK.DAT relevant to those hot keys. This screen listing is automatically read from the active listings in HOOK.EXE and displayed. This screen is removed by Esc or Shift-Alt-Esc. It is also useful to load separate window programs seamlessly so that they may be loaded and switched between with hot keys. The line below indicates this for MathCad assigned to Shift-Alt-M for OS/2 2.1 Am @Win MathCad@ 3 4os2.exe "Start /win /c e:\winmcad\mcad.exe &. exit" ;OS/2 DOS Win 3.1 Windowed Switchable The command processor defined by the OS/2 COMSPEC variable in the environment is used for the PopUp Command Window activated by the key combination Shift-Alt-Ins. HOOK.EXE may be started by placing the appropriate command in a STARTUP.CMD file, by entering it from an OS/2 Window or from a Folder Icon by creating a Program Folder and assigning the Hook location to the Menu in that folder. From the command line or startup.cmd use: Start X:\HOOKdir\HOOK IF X:\HOOKdir not in Path Start HOOK IF X:\HOOKdir is in Path NEW : A 2 character parameter may be passed to HOOK when it is loaded. The format is HOOK XY where X indicates the Hot Key Type : A|a is Shift-Alt C|c is Shift-Ctl Q|q is Alt-Ctl and X :0,1,...9,A,B,...Z is the Hot Key identifier. It can be in either lower case or upper case. Examples: Hook q9 will load hook and immediately execute the Hot Key assigned to Alt-Ctl-9 Hook Ce will load hook and immediatley execute the HotKey assigned to Shft-Ctl-e Hook at will load hook and immediatley execute the HotKey assigned to Shft-Alt-t Since the Paste option allows you to assign strings of HotKeys to execute, you can assign a series of programs to load to such a string and pass that HotKey on the command Line. It is important to remember that the status of the DLL configuration may affect the playing back of macros. In particular if the macro is a playback of keystrokes, the target window must have the focus and this means that the default DLL setting is required. The PASTE Mode PASTE mode is a new option offered for HOOK users. It is switched On/Off by the HotKey combination > Shft-Alt-SpaceBar When PASTE Mode is first initiated a few Beeps are sounded, the Title bar of the HOOK window changes to display "Paste" instead of "KB Hook" and the Frame Window of HOOK flashes. In PASTE mode the built in HotKeys retain the same functionality except that whenever a reference is made to HotKeys, that reference is with respect to the PASTE Mode. Thus, if in PASTE mode you press Shift-Alt-? or Shift-Ctl-? or Alt-Ctrl-? the display will be that for the Descriptions relating to the HotKey assignments for the PASTE Mode text descriptions. When You press a User defined HotKey in PASTE mode it will paste the "text" defined for that key into the Window with the Keyboard Focus. If you press Shift-Alt-F3 you will get the Screen prompting you to enter a HotKey to Addign or Edit and when you do, you will get the Menu Screen for the PASTE mode. To return to normal HotKey reponse just hit Shift-Alt-SpaceBar The HotKeys Assignment Menu - PASTE Mode Screen Displayed below is the format of the Define Hot Keys Screen Menu when PASTE Mode is Active HotKeys Assignment Menu - PASTE Mode Assigning HotKey Shift-Alt-X Paste String: [ ] CR Accepts Description: [ ] CR Accepts [( SAVE Hot Key Assignment )] [(CLEAR Selected Hot Key and EXIT)] [(CLEAR All Hot Keys and EXIT)] Cursor UP/Dn/Left/Right Keys Moves Within Groups SpaceBar or Left Mouse Button to Select Tab Key to Next Group Aborts [(EXIT)] -------------------------- End of Menu ----------------------------------- The only required field here is the String to be Pasted. The maximum string length is 298 characters and may be pure Ascii Text or it may include formatting in the <...> format. RECORDING AND PLAYING BACK MACROS To begin the recording of KeyStrokes and/or Mouse Actions press Shift-Ctrl-LeftArrow or Shift-Ctrl-[. The program window will display a Window Message Prompting you with respect to your first recording action and will then display "Recording" as long as the recording is on. To conclude the recording press Shift-Ctrl-RightArrow or Shift-Ctrl-] and the window will be closed indicating recording is ended. You will also at this point be presented a file dialog box to select a name under which to save the Macro. To abort Saving the Macro just enter Esc. The availability of the optional Shift=Ctrl-[ to begin Macro recording and Shift-Ctrl-] to end recording is made to make recording and play back easier for those editors (such as e.exe, epm.exe and others) which use the Shift-Cursor keys for Text marking and Cut and Paste operations. To PlayBack the Macro just recorded press the Shift_Ctrl-Ins key and the window will display the message "Playback" while it is playing back the events recorded. >New> When "Playback" is displayed pressing the Esc Key will abort the playback. A Macro may also be saved after it has been recorded (if the original prompt for saving was ignored) by pressing Shift-Ctrl-PgDn. A dialogue box will be presented prompting you for the name of the macro file to be stored. The macro is written to X:\HOOKdir with the assigned name in two forms. One form is the binary form that is playable back and has the extension HEX. The other form is in ASCII with the same name but extension MAC and is a listing of the following parameters recorded in the Macro; the values of all except TaskListName are given in HEX.(X above is the drive letter chosen by the user in Install.) Handle MessageID msgParam1 msgParam2 msgTime X_ScreenP Y_ScreenP TaskListName To play back a saved Macro, use Shift_Ctrl-PgUp to activate a dialogue box that will present the list of saved macros. When one is selected it is read into memory and is activated by Shift_Ctrl-Ins Any macro that is created or that is read into memory stays there until replaced by another and thus can be repeatedly used. If a macro is already in memory it can be played back(repeatedly) by Shift-Ctrl-Ins. Macros may also be played back from the command line using PLAYBACK.EXE or PLAYBAKF.EXE(FASTER) for general Macros. From an OS/2 command line : playback filespec or playbakf filespec where filespec is the drive:\directory\macroname.hex specification for the binary file saved by HOOK when a macro was created. Those commands may also be assigned to Hot-Keys so that frequently used Macros are readily available. Again remember that for Key Stroke macros the target window must have the focus to receive the keystrokes - this implies the DLL default configuration option. LIMITATIONS OF MACRO RECORDING The Macro recorder does not record Alt-Esc or Alt-Tab key strokes. It will record and play back messages for actions initiated by the Alt Key and then choosing options from the Control Frame Menu, such as Alt-x to maximize the window, Alt-r to restore the window, etc. If you record a macro that includes MOVING or RESIZING the window, when that aspect of the macro is entered, for reasons I do not yet understand, the system waits for you to move the cursor keys to either resize or move the window. It does record the Ctrl-Esc key sequence and its actions and other keyboard entries including the Shift-ALt|Ctrl-X keys assigned to this program and their actions and also mouse actions. It does not however faithfully play back everything recorded for reasons I also do not frankly understand. For instance if you assign to a Macro the sequence (from an OS/2 window) Help DownCursor DownCursor CR, it does not play back the DownCursor DownCursor CR sequence though it does open the Help Window. However if you save (e.g.) the sequence "Help Dir" from a command line it will play that back correctly. When you are recording anything from the Command Line, after using the Shift-Ctrl-LeftArrow (or Shift-Ctrl-[ ) key strokes to start the macro, you must use the Mouse to activate the window you were in or else an assigned Shift-xxx-xxx action to get back into that window. This is because displaying the Message "Recording" in the Hook window makes that the active window. There is a Prompt reminding the user to make the shift to the desired active window. When activating a Macro you must be careful that your setup is similar to that used when recording it, particularly if writing text is a part of the scenario - you might get the text written back in a non-intended window. Since the macros when recorded, record positions in screen coordinates, which are absolute relative to the bottom left corner, any actions depending on a mouse action such as clicking on a minimize or maximize button will be sensitive to where that button is on the screen. If a window is not displayed at exactly the same position as it was when recording, those mouse actions will not be what is intended. The macros do a good job of recording keystrokes and their playback is faithful and fast. However if the Keystrokes were recorded from a non PM window they will only play back to a non-PM window and vice versa. I find the macros most useful for storing and setting up different groups of windows. For instance I have one mode of operations where I have my editor open in two different OS/2 windows, 2 DOS windows open with different versions of FoxPro in them and an OS/2 window for command line use. I have that set of keystrokes assigned to a macro I have named to FOXLOAD.HEX and when I want to re-establish that set of windows I load it into memory using Shift_Ctrl-PgUp to select and load it and play it back with Shift-Ctrl-Ins. This can now be done more easily by assigning the sequence of KeyStrokes to a HotKey and executing that HotKey. MACRO RECORDING now omits WM_MOUSEMOVE messages. This speeds up playback and loses nothing since those messages just display the mouse pointer moving from one location to another. The actions at the end of that are unchanged. Finally the Buffer used to store the messages is of finite size. Each message is 28 bytes long and the buffer size is 56000 bytes and thus holds 2000 messages. If your recording exceeds the buffer size the program notifies you. The program macro PlayBack facility will now run under either OS/2 version 2.0 /2.1/WARP as it determines the Handle of the Task List Window on the Fly, in this respect it should be immune to updates. The messageID of the Task List is not documented but it is 082H and it has a fixed handle value that changed from version 2.0 to 2.1. The value is stored in the Task List Buffer at offset 8, which is where I get it on loading HOOK. Currently the macros are not played back at the speed at which they were recorded but somewhat faster. This is because it is presumed and certainly I do, that one uses Macros for convenience and speed. That sometimes gives a problem, especially if mouse movements are involved. For opening up icons on the screen I find it convenient to follow the procedure of going to the desktop, (or other window as the case may be) and clicking the left mouse button to establish the location, then press the Home key to bring you to the upper left icon of that window, and then use the cursor keys to bring you to the desired icon to open and then press enter to open it and so on. DOS WINDOWED SESSIONS and FULL SCREEN SESSIONS There are limitations to using the Macro Recorder from a DOS session. It will record and play back actions reflecting OS/2 aspects, such as using the Alt key to activate a frame menu and select an options, such as Alt-x (maximize),etc or Ctrl-Esc to activate the Task List and make a selection but it will not record ordinary keyboard entry or any activity from within a DOS session relating to the DOS software program. That is because in DOS the PM message queue is not active and normal DOS KB TSR's are required if you need to intercept Keystrokes in DOS. A similar comment holds for OS/2 Full Screen. There monitors are required to read Keyboard Activity and the PM message queue does not apply. If I need to use an application in Full Screen, then I use Ctrl-Esc to bring up the TaskList window and from there the Hot Keys are valid since you are in PM. Notwithstanding the limitations above, I have found this most useful and it is worth playing around with to understand both its utility and its limitations. FULL SCREEN APPLICATIONS INCLUDING FULL SCREEN APPLICATIONS If you have an application that you want to run in Full Screen then in HOOK.DAT so define it by entering the number 1 OR 4 in the column following the key id, AltX 1 or CtrlX 4 if you want the session to be Full Screen OS/2 OR Full Screen DOS respectively. From the Define Hot Key Menu the choice is clear. Doing it this way assigns the Task List Title the name Alt-X or Ctl-X as when loaded with the 0 option or 7 option. This means that the program is loaded Full Screen with the assigned Key Combination and if the program is already loaded, it can be switched to from the desktop by hitting its Hot-Key and if you are in the full screen mode, then pressing Ctrl-Esc brings up the Task List, which is a PM and the hot keys are active from there. This means that switching to Full Screen applications from the Desktop is the same as if they are windowed and switching back from Full Screen applications takes only 1 more Key Combination to switch to a Windowed Application. Similarly switching between Full Screen applications also takes only one more Keyboard action, the Ctrl-Esc to the Task List and then the use of the appropriate Hot-Key. Screen Resolution I have tested this program with screen resolutions of 640x480, 800x600 and 1024x768. In all three cases, ON MY System, all of the menus and screens of HOOK are contained within the display screen correctly. HOOK determines the screen resolution and adjusts its parameters accordingly. Nonethelss some users have reported problems with Menu integrity. Please let me know if such exists on your system and if so what Video Board and Monitor you are using. It is not that I can necessarily do anything about it, but at least I can build up some data base in this area. ABOUT THIS PROGRAM HOOK vs. 5.60 This program and its accompanying DLLs was written in 32 bit Assembler. The assembler used was Microsoft's MASM 6.00b and the OS/2 2.1 ToolKit and its resources were used for compiling the INF file and the resource files used. If you have any interest in obtaining the source code and how to assemble it, contact me via compuserve or at the address indicated below. The program is FreeWare. Vs: 5.60. Sat 08-24-96 Morton F. Kaplon 1047 Johnston Drive Bethlehem PA 18017 Voice: 610/758-9686 FAX: 610-758-9262 CompuServe ID 73457,437 E-Mail emkay@fast.net