🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14545

Re: SetWindowsHookEx & WH_KEYBOARD

#14545
From: Roger Lindgren
Date: Mon, 11 Aug 2003 08:50
17 lines
1842 bytes
I don't really know how you implemented this, but this dll will not send 
any messages to your window.
For that you need to send PostMessage from the hook procedure.
Possibly using HWND_BROADCAST.
And make your own user message with RegisterWindowMessage (Do not 
broadcast WM_KEYDOWN or WM_KEYUP :-P )

You should also have a function that calls UnhookWindowsHookEx before 
you free the library, but that's another matter.

I have not used WH_KEYBOARD myself, but have been hooking to get 
screensaverstart and other things,
so I don't know if windows may have some security on Keyboard hooks 
making it bypass any hooks. But otherwise it should works if you 
actually send the message to your window (or all topwindows)

Hope you understand my bad english :-)
Technical Details
Message-ID: <3f3758c8$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f374896@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,65d385623513ec23
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-11 02:01:40 PST
Date: Mon, 11 Aug 2003 10:50:17 +0200
From: Roger Lindgren <bc@REMOVETHISottoirc.nu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: SetWindowsHookEx & WH_KEYBOARD
References: <3f374896@newsgroups.borland.com>
In-Reply-To: <3f374896@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 194.236.55.227
Message-ID: <3f3758c8$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1060591816 194.236.55.227 (11 Aug 2003 01:50:16 -0700)
Lines: 18
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail