home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / JUMP.ZIP / JUMPHOOK.C < prev    next >
Text File  |  1991-09-05  |  1KB  |  43 lines

  1. /*--------------------------------------------------------------------
  2.    This is the hook procedure - since it is a system hook, it reads
  3.    all messages in the input queue and must reside in a DLL.
  4.    When it sees the Alt-Pageup then it clears the JUMP semaphore.
  5.    JUMP.EXE which is waiting on the JUMP semaphore will then do
  6.    it's stuff and re-set the semaphore.
  7. -----------------------------------------------------------------*/
  8.  
  9. #define INCL_DOS
  10. #define INCL_ERRORS
  11. #define INCL_PM
  12. #include <os2.h>
  13.  
  14. #include <stdio.h>
  15. #include <string.h>
  16.  
  17. #include "jumphook.h"
  18.  
  19. int            _acrtused = 0;
  20.  
  21. BOOL EXPENTRY JumpHookProc( HAB, PQMSG, USHORT );
  22.  
  23. BOOL EXPENTRY JumpHookProc( hab, pqmsg, usRemove )
  24. HAB            hab;
  25. PQMSG          pqmsg;
  26. USHORT         usRemove;
  27.   {
  28.  
  29.     /* Only care about WM_CHAR messages */
  30.     /*Ignore KEYUP, process down       */
  31.    /* Check if the key pressed matches */
  32.  
  33.   if( pqmsg->msg == WM_CHAR                  &&
  34.    !( SHORT1FROMMP(pqmsg->mp1) & KC_KEYUP ) &&
  35.     ( SHORT1FROMMP(pqmsg->mp1) & KC_ALT )   &&
  36.      SHORT2FROMMP(pqmsg->mp2) == VK_PAGEUP )
  37.   {
  38.       DosOpenSem(&hsemJump,SEM_NAME);
  39.       DosSemClear(hsemJump);
  40.   }
  41.    return( FALSE );
  42. }
  43.