🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #1890

Message hooks, anyone?

#1890
From: Raptor
Date: Fri, 29 Mar 1991 17:54
28 lines
1607 bytes
I'm trying to install a message hook in my application so I can filter
out messages to other/all applications.  Has anyone gotten this to
work for them?  SetWindowsHook(WH_GETMESSAGE, lpProc) and
UnsetWindowsHook(WH_GETMESSAGE, lpProc).

I can install it fine, and watch my hook function execute through cvw.
It sure seems to be scanning all the messages.

But when I decide to de-install it, I get an access violation.  I've
watched the ProcInstance of my hook function and it never changes,
though my code and data segments are moveable.  I've put a redundant
FARPROC cast in the call to UnsetWindowsHook() but that doesn't help.

One idiosyncracy I've noticed is, SetWindowsHook returns NULL for the
address of the next hook function.  The documentation doesn't say to
do anything special in this case, though I can accept that nothing
special needs to be done.

Would code segments help anyone in their diagnosis?




-- 
Lynn Wallace			   |I am not an official representative of
Evans and Sutherland Computer Corp.| <- E&S.  Or for that matter, unofficial.
Salt Lake City, UT 84108	   |Internet: lwallace@javelin.sim.es.com
			War not make one great! -- Yoda
Technical Details
Message-ID: <1991Mar29.175435.15161@javelin.es.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!orca!javelin.es.com!lwallace

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!orca!javelin.es.com!lwallace
From: lwallace@javelin.es.com (Raptor)
Newsgroups: comp.windows.ms.programmer
Subject: Message hooks, anyone?
Message-ID: <1991Mar29.175435.15161@javelin.es.com>
Date: 29 Mar 91 17:54:35 GMT
Organization: Evans & Sutherland Computer Corp., Salt Lake City, Utah
Lines: 28