Category : Files from Magazines
Archive   : PJ92.ZIP
Filename : GMHOOK.C

 
Output of file : GMHOOK.C contained in archive : PJ92.ZIP
#include "windows.h"
#include "gmhook.h"

FARPROC lpfnOldGMHook = 0;
HWND hwndCallBackGM = 0;
BOOL bGMHookActive = FALSE;
unsigned usMsgGM = 0;
WORD _acrtused = 0;

DWORD FAR PASCAL whGetMessageHook(int iCode, WORD wParm, LPMSG lParm)
{
if (iCode < 0) {
return(DefHookProc(iCode, wParm, (LONG)lParm, &lpfnOldGMHook));
}
if ((iCode == HC_ACTION) && bGMHookActive) {
if (lParm) {
if (lParm->message == WM_NCRBUTTONDBLCLK) {
PostMessage(hwndCallBackGM, usMsgGM, 0, 0L);
}
}
}
return(DefHookProc(iCode, wParm, (LONG)lParm, &lpfnOldGMHook));
}

VOID FAR PASCAL whInstallGMHook(HWND hwnd, unsigned msg)
{
lpfnOldGMHook = SetWindowsHook(WH_GETMESSAGE, (FARPROC)whGetMessageHook);
hwndCallBackGM = hwnd;
usMsgGM = msg;
}

VOID FAR PASCAL whRemoveGMHook(VOID)
{
UnhookWindowsHook(WH_GETMESSAGE, (FARPROC)whGetMessageHook);
}

BOOL FAR PASCAL whEnableGMHook(BOOL bEnable)
{
return(bGMHookActive = bEnable);
}

int FAR PASCAL LibMain(HANDLE hModule, WORD wDataSeg,
WORD cbHeapSize, LPSTR lpszCmdLine)
{
return(1);
}

int FAR PASCAL WEP(int bSystemExit)
{
return(1);
}



  3 Responses to “Category : Files from Magazines
Archive   : PJ92.ZIP
Filename : GMHOOK.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/