Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how do I know the message in hook procedure KeyboardProc()?

how do I know the message in hook procedure KeyboardProc()?

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    code_discuss
    wrote on last edited by
    #1

    I set a keyboard hook and my KeyboardProc() get called on WM_KEYDOWN. But I need to know the message which trick the key board hook. I need to know which HWND the current key down message is sent to. The thress passed in parameters 'code, wParam, lParam' don't give me any hint.

    N T 3 Replies Last reply
    0
    • C code_discuss

      I set a keyboard hook and my KeyboardProc() get called on WM_KEYDOWN. But I need to know the message which trick the key board hook. I need to know which HWND the current key down message is sent to. The thress passed in parameters 'code, wParam, lParam' don't give me any hint.

      N Offline
      N Offline
      Nelek
      wrote on last edited by
      #2

      Can't you use the GetActiveWnd () inside your WM_KEYDOWN?

      Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

      1 Reply Last reply
      0
      • C code_discuss

        I set a keyboard hook and my KeyboardProc() get called on WM_KEYDOWN. But I need to know the message which trick the key board hook. I need to know which HWND the current key down message is sent to. The thress passed in parameters 'code, wParam, lParam' don't give me any hint.

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        code_discuss wrote:

        I need to know which HWND the current key down message is sent to.

        will GetFocus help?

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
        Never mind - my own stupidity is the source of every "problem" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

        1 Reply Last reply
        0
        • C code_discuss

          I set a keyboard hook and my KeyboardProc() get called on WM_KEYDOWN. But I need to know the message which trick the key board hook. I need to know which HWND the current key down message is sent to. The thress passed in parameters 'code, wParam, lParam' don't give me any hint.

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          Please ignore my last post, correct api would be GetForegroundWindow..

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
          Never mind - my own stupidity is the source of every "problem" - Mixture

          cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups