home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
JUMP.ZIP
/
JUMPHOOK.C
< prev
next >
Wrap
Text File
|
1991-09-05
|
1KB
|
43 lines
/*--------------------------------------------------------------------
This is the hook procedure - since it is a system hook, it reads
all messages in the input queue and must reside in a DLL.
When it sees the Alt-Pageup then it clears the JUMP semaphore.
JUMP.EXE which is waiting on the JUMP semaphore will then do
it's stuff and re-set the semaphore.
-----------------------------------------------------------------*/
#define INCL_DOS
#define INCL_ERRORS
#define INCL_PM
#include <os2.h>
#include <stdio.h>
#include <string.h>
#include "jumphook.h"
int _acrtused = 0;
BOOL EXPENTRY JumpHookProc( HAB, PQMSG, USHORT );
BOOL EXPENTRY JumpHookProc( hab, pqmsg, usRemove )
HAB hab;
PQMSG pqmsg;
USHORT usRemove;
{
/* Only care about WM_CHAR messages */
/*Ignore KEYUP, process down */
/* Check if the key pressed matches */
if( pqmsg->msg == WM_CHAR &&
!( SHORT1FROMMP(pqmsg->mp1) & KC_KEYUP ) &&
( SHORT1FROMMP(pqmsg->mp1) & KC_ALT ) &&
SHORT2FROMMP(pqmsg->mp2) == VK_PAGEUP )
{
DosOpenSem(&hsemJump,SEM_NAME);
DosSemClear(hsemJump);
}
return( FALSE );
}