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 to catch keyboard and mouse events of all windows?

How to catch keyboard and mouse events of all windows?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
5 Posts 4 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.
  • M Offline
    M Offline
    Mustafa Demirhan
    wrote on last edited by
    #1

    Hello, I wonder if i can catch all mouse and keyboard events of all windows from a hidden application in VC++/MFC. For example, i want to do special things if some key pairs are pressed (like in macro magic). Mustafa Demirhan

    R J S 3 Replies Last reply
    0
    • M Mustafa Demirhan

      Hello, I wonder if i can catch all mouse and keyboard events of all windows from a hidden application in VC++/MFC. For example, i want to do special things if some key pairs are pressed (like in macro magic). Mustafa Demirhan

      R Offline
      R Offline
      Remus Lazar
      wrote on last edited by
      #2

      Usualy you must obtain messages from windows and you could do this by "subclassing" every process. For more informations read in MSDN.(try a serch using "Subclassing Windows" and you will find some TehnicalArticles usefull enough about this) regards, /REMUS

      S 1 Reply Last reply
      0
      • M Mustafa Demirhan

        Hello, I wonder if i can catch all mouse and keyboard events of all windows from a hidden application in VC++/MFC. For example, i want to do special things if some key pairs are pressed (like in macro magic). Mustafa Demirhan

        J Offline
        J Offline
        Jamie Nordmeyer
        wrote on last edited by
        #3

        You will need to use SetWindowHook. Hooking can be rather complex, so be sure to read the documentation on it carefully.

        1 Reply Last reply
        0
        • R Remus Lazar

          Usualy you must obtain messages from windows and you could do this by "subclassing" every process. For more informations read in MSDN.(try a serch using "Subclassing Windows" and you will find some TehnicalArticles usefull enough about this) regards, /REMUS

          S Offline
          S Offline
          Sam Hobbs
          wrote on last edited by
          #4

          I have certainly heard of subclassing windows but not subclassing processes. I doubt that such a thing is possible.

          1 Reply Last reply
          0
          • M Mustafa Demirhan

            Hello, I wonder if i can catch all mouse and keyboard events of all windows from a hidden application in VC++/MFC. For example, i want to do special things if some key pairs are pressed (like in macro magic). Mustafa Demirhan

            S Offline
            S Offline
            Sam Hobbs
            wrote on last edited by
            #5

            Most all documentation relevant to SetWindowsHookEx is listed in: http://home.socal.rr.com/samhobbs/VC/Hooks.html It is definitely advanced stuff and I think that anyone attempting to implement such stuff need to expect to spend at least two weeks, probably a month learning what needs to be learned to be able to use the capability and related things effectively, safely and efficiently.

            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