Article View: borland.public.cppbuilder.nativeapi
Article #7407Re: About Keyboard hooking & KBDLLHOOKSTRUCT
From: Vladimir Stefanovic
Date: Thu, 03 Feb 2005 18:05
Date: Thu, 03 Feb 2005 18:05
44 lines
2091 bytes
2091 bytes
Great !
I added this statement at the code I already have:
if ( ! ( lParam & ( 1<<29 ) ) )
return CallNextHookEx( ghhookKB, nCode, wParam, lParam );
... and it works! Thanks a lot.
Best regards,
Vladimir Stefanovic
"Bob Gonder" <notbg@notmindspring.invalid> wrote in message
news:0do401dejfcqd60m486gdd08eii7ruibkr@4ax.com...
> Vladimir Stefanovic wrote:
>
>>Can someone please interpret me something about Keyboard
>>Hooking. When I press a key, is it true that the structure
>>KBDLLHOOKSTRUCT saved also the modifier (Alt, Shift, ...)
>>state? I need this because I want to SendMessage() to the
>>main app only when, for example Alt is pressed also.
>
> See the subject: KeyboardProc()
> in WIN32.HLP.
>
>
>>What means 'return 1',
>
> It tells Windows to drop the message.
> If you return 0, then Windows will pass the key to the target window.
>
>
>> and is there a way to extend my code (below)
>>to work with checking for Alt?
>
> Check bit 29 (zero-based) of lparam.
> 1 == Alt
>
> if ( lParam & (1<<29) )
> ItIsAnAlt=true;
>
>
>
Technical Details
Message-ID:
<420267d4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<42021449@newsgroups.borland.com> <0do401dejfcqd60m486gdd08eii7ruibkr@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8625c090d856cce0 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu> Newsgroups: borland.public.cppbuilder.nativeapi References: <42021449@newsgroups.borland.com> <0do401dejfcqd60m486gdd08eii7ruibkr@4ax.com> Subject: Re: About Keyboard hooking & KBDLLHOOKSTRUCT Date: Thu, 3 Feb 2005 19:05:14 +0100 Lines: 46 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 82.117.212.65 Message-ID: <420267d4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1107453908 82.117.212.65 (3 Feb 2005 10:05:08 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail