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. Disable keyboard & mouse input

Disable keyboard & mouse input

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
8 Posts 2 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
    Cpp_Com
    wrote on last edited by
    #1

    Hi All i need a c++ code to disable keyboard and mouse input. can any body help me. I didn't find much help on net. Thank u all in advance. Cheers, Sus.

    A 1 Reply Last reply
    0
    • C Cpp_Com

      Hi All i need a c++ code to disable keyboard and mouse input. can any body help me. I didn't find much help on net. Thank u all in advance. Cheers, Sus.

      A Offline
      A Offline
      Adam Roderick J
      wrote on last edited by
      #2

      If you want to block the Key board and mouse input reaching your application then use BlockInput API [^]

      Величие не Бога может быть недооценена.

      C 1 Reply Last reply
      0
      • A Adam Roderick J

        If you want to block the Key board and mouse input reaching your application then use BlockInput API [^]

        Величие не Бога может быть недооценена.

        C Offline
        C Offline
        Cpp_Com
        wrote on last edited by
        #3

        Thank u very much for the reply. can i use this methode it in consol based c++ application?

        A 1 Reply Last reply
        0
        • C Cpp_Com

          Thank u very much for the reply. can i use this methode it in consol based c++ application?

          A Offline
          A Offline
          Adam Roderick J
          wrote on last edited by
          #4

          So you want to block the keyboard and mouse input of that console application?

          Величие не Бога может быть недооценена.

          C 1 Reply Last reply
          0
          • A Adam Roderick J

            So you want to block the keyboard and mouse input of that console application?

            Величие не Бога может быть недооценена.

            C Offline
            C Offline
            Cpp_Com
            wrote on last edited by
            #5

            yes. Is it possible? or i shd go 4 dialogue based application.?

            A C 2 Replies Last reply
            0
            • C Cpp_Com

              yes. Is it possible? or i shd go 4 dialogue based application.?

              A Offline
              A Offline
              Adam Roderick J
              wrote on last edited by
              #6

              Yess 100% possible :) you need to include these files is needed #include <afx.h> #include <winable.h> But i cannot understand the purpose of doing so.

              Величие не Бога может быть недооценена.

              1 Reply Last reply
              0
              • C Cpp_Com

                yes. Is it possible? or i shd go 4 dialogue based application.?

                C Offline
                C Offline
                Cpp_Com
                wrote on last edited by
                #7

                i wrote like this #include <iostream> #include <windows.h> #include <winable.h> using namespace std; int main() { BlockInput(true); Sleep(5000); return 0; } its working fine for 5000ms only. but my motto is to unlock the system while i press esc key. how to do this? plz help.

                A 1 Reply Last reply
                0
                • C Cpp_Com

                  i wrote like this #include <iostream> #include <windows.h> #include <winable.h> using namespace std; int main() { BlockInput(true); Sleep(5000); return 0; } its working fine for 5000ms only. but my motto is to unlock the system while i press esc key. how to do this? plz help.

                  A Offline
                  A Offline
                  Adam Roderick J
                  wrote on last edited by
                  #8

                  BlockInput itself is done to block any keyboard event till some action is over. So how can it be possible to click of ESC to work?

                  Величие не Бога может быть недооценена.

                  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