TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Daniel Doran
from: Peter Fitzsimmons
date: 1995-11-12 05:44:16
subject: WinSetHook()

DD> Does anyone have a working example of using hooks with WinSetHook(),
 DD> particularly for input or journal hooks (HK_INPUT,
 DD> HK_JOURNALRECORDHOOK, HK_JOURNALPLAYBACKHOOK).

 DD> I've tried to use this, and the hook seems to get set, but my hook
 DD> function seems to get the same message from the queue over and over and
 DD> over.

 DD> Also, the third parameter of my InputHook() function never seems to be
 DD> either of the values I'd expect {PM_REMOVE or PM_NOREMOVE}.

It sounds like your hook procedure is using the wrong calling convention. 
It should be using _System.

Here is a sample system input hook.  I have indented the uuencoded file by
one column to prevent word wrapping.  32bit Watcom or IBM C compiler
required.

 begin 0666 syshook.lzh
 M'W M;&{at}P+1\    ?    CX),'P  "6=O:6)M+F-M9'IE;FUA:V4{at}+VYO;&]G
 M;R O9B!M86ME9FEL92YI8FT-"AYL+6QH-2U_    LP    V"3!\   AG;W=C
 M+F-M9*,{at} &92EZTH;SH/?N%Y9:{at}B+&X(FX(*(({at}>'_#G[D<7Z2M){at}O''[M0\
 M- {at}A;RO%90%#Q+3KU*G^>?SCB\4IW\:>'3ZC? EA8Q4U6WKNY\I{at}N2&
 M#O0/'/0%P7NT).BC5DVO*G-#R4*#_#39LA&ED?W7V8B>U&/]K29F>>*CP!Z0
 M+6QH-2U_    LP   '{at}B*!X   AI;FET+F%S;46K ')3=K&E"*^DU_],IM!)
 M&,*H%!I#&%!IL$W1{at}S;C3=M%\+[>]X0O3B.(9\
 MS{at}P/EY;EB)(5/$45W66T34P1).(#%*ME]: 7V,#%C6]#RC5U[75Z\NL{at}?#/$
 M&6$)N^W/W'_ $;'__":2IM438)B;Z"+(+6QH-2VH    90$  ),%#A\   QM
 M86ME9FEL92YI8FUY:0"-4G.-J%1Z%G_)=X*")F/M 1,"PV'M=4:MNL#] SQR
 M^M:Y^K;9&DUJO>^L"]EXC'U5B]X9M+.INC5JEVFS'#SK#,6H#XYC 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488 (1:259/414)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 517 628 713/888 800/1 7877/2809
@PATH: 259/414 400 99 250/99 3615/50 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.