Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6930063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:23:55+00:00 2026-05-27T11:23:55+00:00

In a Windows native DLL running inside an application, I’ve installed a keyboard hook

  • 0

In a Windows native DLL running inside an application, I’ve installed a keyboard hook with the following callback procedure:

LRESULT CALLBACK onKeyHookEvent_(int code, WPARAM keyCode, LPARAM keyFlags)
{
    if (code < 0)
        return CallNextHookEx(NULL, code, keyCode, keyFlags);

    if (keyFlags & KF_UP)
        doSomething();

    return 0;
}

But the procedure never gets a keyFlags with the KF_UP bit(s) set. My fear is that the main application is somehow “swallowing” the release events before they get to my hook.

Is there anything else I must do to make a keyboard hook sensitive to key releases?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:23:55+00:00Added an answer on May 27, 2026 at 11:23 am

    It appears that the KF_UP mask must be shifted into the high position of a 32-bit word. The correct code:

    static const long keyUpMask = static_cast<long>(KF_UP) << 16;
    
    ...
    
    if (keyFlags & keyUpMask)
        doSomething();
    

    The weird thing is, I see no mention of this in the MSDN documentation on KeyboardProc callbacks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have many C/C++ old native .exe and .dll programs running on Windows servers
We have Win Forms application uses the 3rd party windows native controls. Can these
I am developing a native application for Windows Mobile 6.5 (Samsung Omnia II i8000).
I am writing a Windows CE application in C# that references a native C++
I am not able to delete a native image : del c:\windows\assembly\native...\mscorlib\xxxx\mscorlib.ni.dll access refused
Is there any free native Windows DLL export functions viewer, which shows the function
There are several type of dlls found on windows platform Old style native dll
I have a native Windows DLL written in C. This DLL is designed to
is there a way to invoke functions in native libraries (Windows .dll's, Linux .so's),
Visual studio debugger hangs while loading symbols for my application(native IA64), SP1 is installed.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.