Article View: borland.public.cppbuilder.nativeapi
Article #14422Re: how to map keystrokes
From: Anibal
Date: Wed, 13 Aug 2003 13:45
Date: Wed, 13 Aug 2003 13:45
40 lines
2169 bytes
2169 bytes
Sorry!
Don't consider the previous post!
Here is the code that doesn't run.
class THook
{
private:
protected:
public:
__fastcall THook();
virtual __fastcall ~THook();
void __fastcall SetHook();
HHOOK KeyboardHook;
DWORD CurrentThreadID;
LRESULT CALLBACK KeyboardHookProcedure(int Code, WPARAM wParam, LPARAM
lParam);
};
//--------------------------------------------------------------------------
-
LRESULT CALLBACK THook::KeyboardHookProcedure(int Code, WPARAM wParam,
LPARAM lParam)
{
return CallNextHookEx(KeyboardHook, Code, wParam, lParam);
}
//--------------------------------------------------------------------------
-
void __fastcall THook::SetHook()
{
CurrentThreadID = GetCurrentThreadId();
KeyboardHook = SetWindowsHookEx(WH_KEYBOARD,
(HOOKPROC)KeyboardHookProcedure, HInstance, CurrentThreadID);
}
//--------------------------------------------------------------------------
-
andre|braz
Technical Details
Message-ID:
<3f3a406b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!diablo.voicenet.com!in.100proofnews.com!in.100proofnews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f37d1d2@newsgroups.borland.com> <3f37d2da$1@newsgroups.borland.com> <3f37d498@newsgroups.borland.com> <3f38d0fd@newsgroups.borland.com> <3f392e9b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,b8d2e09f76f4f6e3 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-13 07:10:34 PST From: "Anibal" <anibal@nospam.trigenius.pt> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f37d1d2@newsgroups.borland.com> <3f37d2da$1@newsgroups.borland.com> <3f37d498@newsgroups.borland.com> <3f38d0fd@newsgroups.borland.com> <3f392e9b$1@newsgroups.borland.com> Subject: Re: how to map keystrokes Date: Wed, 13 Aug 2003 14:45:55 +0100 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 213.13.119.156 Message-ID: <3f3a406b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1060782187 213.13.119.156 (13 Aug 2003 06:43:07 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!diablo.voicenet.com!in.100proofnews.com!in.100proofnews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail