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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. keyboard strokes

keyboard strokes

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 3 Posters 1 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.
  • H Offline
    H Offline
    happycpp
    wrote on last edited by
    #1

    hello everyone... i have a small question: i want to intercept keyboard strokes being sent to applications...for example i want the 'a' button to send a 'b' to applications instead of 'a'...should i use hooks or subclassing...i need to know what are the appropiate APIs that should be used.. note:i want this to be done for all applications ((processes)) not only one...

    T J 2 Replies Last reply
    0
    • H happycpp

      hello everyone... i have a small question: i want to intercept keyboard strokes being sent to applications...for example i want the 'a' button to send a 'b' to applications instead of 'a'...should i use hooks or subclassing...i need to know what are the appropiate APIs that should be used.. note:i want this to be done for all applications ((processes)) not only one...

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

      Hook is better , just try global Keyboard hook. saeedmalas wrote: .i need to know what are the appropiate APIs that should be used.. SetWindowsHookEx(...) ,but for Global hook you have to create a dll. look for more example here :- http://www.codeproject.com/system/hooksys.asp http://www.codeproject.com/system/Paladin.asp http://www.codeproject.com/dll/hooks.asp


      "I Think this Will Help" [Vote One Here,.....]

      visit me at http://www.thisisalok.tk
      H 1 Reply Last reply
      0
      • T ThatsAlok

        Hook is better , just try global Keyboard hook. saeedmalas wrote: .i need to know what are the appropiate APIs that should be used.. SetWindowsHookEx(...) ,but for Global hook you have to create a dll. look for more example here :- http://www.codeproject.com/system/hooksys.asp http://www.codeproject.com/system/Paladin.asp http://www.codeproject.com/dll/hooks.asp


        "I Think this Will Help" [Vote One Here,.....]

        visit me at http://www.thisisalok.tk
        H Offline
        H Offline
        happycpp
        wrote on last edited by
        #3

        it looks like that using SetWindowsHookEx is only for monitoring not modifying...i actually want to prevent a message from reaching applications or modifying that message before reaching them..not just see what the message is...

        T 1 Reply Last reply
        0
        • H happycpp

          it looks like that using SetWindowsHookEx is only for monitoring not modifying...i actually want to prevent a message from reaching applications or modifying that message before reaching them..not just see what the message is...

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

          Actually after hooking you can use GetWindowLong to to get Window procedure of any window and you can modify the charater from there. look for that in more Detail in the link given by me in last post


          "I Think this Will Help" [Vote One Here,.....]

          visit me at http://www.thisisalok.tk
          H 1 Reply Last reply
          0
          • H happycpp

            hello everyone... i have a small question: i want to intercept keyboard strokes being sent to applications...for example i want the 'a' button to send a 'b' to applications instead of 'a'...should i use hooks or subclassing...i need to know what are the appropiate APIs that should be used.. note:i want this to be done for all applications ((processes)) not only one...

            J Offline
            J Offline
            John R Shaw
            wrote on last edited by
            #5

            This is not a small question! There are aticles at CP that may give you the information that you seak. I'll tell you this much, you need to use hooks. INTP "The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes." Andrew W. Troelsen

            1 Reply Last reply
            0
            • T ThatsAlok

              Actually after hooking you can use GetWindowLong to to get Window procedure of any window and you can modify the charater from there. look for that in more Detail in the link given by me in last post


              "I Think this Will Help" [Vote One Here,.....]

              visit me at http://www.thisisalok.tk
              H Offline
              H Offline
              happycpp
              wrote on last edited by
              #6

              if i'm going to do that,i think i have to get the Window procedure of all windows of all processes...i think that's a very hard work..isn't there an easier way..

              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