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#
  4. Disabling keyboard keys

Disabling keyboard keys

Scheduled Pinned Locked Moved C#
help
10 Posts 5 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.
  • P Offline
    P Offline
    Prashant Gadhave
    wrote on last edited by
    #1

    I am working on a windows application .This application will be running in the background and capturing all the keystrokes .All the short-cut keys need to be disabled i.e. Alt+F4 or windows+M etc by this application.If the user presses alt+ctrl+8 he should be shown a login screen and if he is authorised the keys should be enabled according to his permission level i.e Admin ,user etc. If this application has got the focus then only it captures events , but as the case mostly is ,there is some other application running which will have focus but I still want to get these keystroke events in my application .Any help please. Thank you.

    J 1 Reply Last reply
    0
    • P Prashant Gadhave

      I am working on a windows application .This application will be running in the background and capturing all the keystrokes .All the short-cut keys need to be disabled i.e. Alt+F4 or windows+M etc by this application.If the user presses alt+ctrl+8 he should be shown a login screen and if he is authorised the keys should be enabled according to his permission level i.e Admin ,user etc. If this application has got the focus then only it captures events , but as the case mostly is ,there is some other application running which will have focus but I still want to get these keystroke events in my application .Any help please. Thank you.

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      That sounds like either a) a virus or b) some other form of malware you are writing there. If im wrong, then please feel free to explain a legit reason to have this functionality! Until then I hope nobody gives you any advice. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

      P N 2 Replies Last reply
      0
      • J J4amieC

        That sounds like either a) a virus or b) some other form of malware you are writing there. If im wrong, then please feel free to explain a legit reason to have this functionality! Until then I hope nobody gives you any advice. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

        P Offline
        P Offline
        Prashant Gadhave
        wrote on last edited by
        #3

        I am neither creating a virus nor any malware . I am working in a company whose product is kiosk .For its security purpose I need to implement this functunality so please help .

        J 1 Reply Last reply
        0
        • J J4amieC

          That sounds like either a) a virus or b) some other form of malware you are writing there. If im wrong, then please feel free to explain a legit reason to have this functionality! Until then I hope nobody gives you any advice. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

          N Offline
          N Offline
          nueer
          wrote on last edited by
          #4

          Well, you wil finds solution anything what it needs for. Watch this code project article: Low-level Windows API hooks from C# to stop unwanted keystrokes [^] Goodluck with virus or whatevar. Worry is not needed Im sure, to be infected at my pc. I use McAfee. Be sure to use .Net 1.1... or your virus won't run on as many Windows installations...

          T D 2 Replies Last reply
          0
          • P Prashant Gadhave

            I am neither creating a virus nor any malware . I am working in a company whose product is kiosk .For its security purpose I need to implement this functunality so please help .

            J Offline
            J Offline
            J4amieC
            wrote on last edited by
            #5

            Kiosks dont use traditional keyboards, so why would you need to deactivate keyboard input? Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

            P 1 Reply Last reply
            0
            • N nueer

              Well, you wil finds solution anything what it needs for. Watch this code project article: Low-level Windows API hooks from C# to stop unwanted keystrokes [^] Goodluck with virus or whatevar. Worry is not needed Im sure, to be infected at my pc. I use McAfee. Be sure to use .Net 1.1... or your virus won't run on as many Windows installations...

              T Offline
              T Offline
              thelastjedi
              wrote on last edited by
              #6

              I am unaware of the users intentions, however there can be legit reasons for wanting to do so. For example, an internet cafe owner may wish to disallow the paying customer from doing anythign else other than IE. A school's public computer might want to restrict the 'children' from installing stuff and/or fiddling around with the windows registry. An internet kiosk (like the one at airports ... and they usually have normal keyboards embedded in metal) where public can't be trusted enough from installing stuff and/or gaining access rights on the Pc ... etc ... Use your imagination ... Jedi

              1 Reply Last reply
              0
              • N nueer

                Well, you wil finds solution anything what it needs for. Watch this code project article: Low-level Windows API hooks from C# to stop unwanted keystrokes [^] Goodluck with virus or whatevar. Worry is not needed Im sure, to be infected at my pc. I use McAfee. Be sure to use .Net 1.1... or your virus won't run on as many Windows installations...

                D Offline
                D Offline
                Dan Neely
                wrote on last edited by
                #7

                nueer wrote:

                Goodluck with virus or whatevar. Worry is not needed Im sure, to be infected at my pc. I use McAfee.

                Maybe. I've recently written a keyboard/mouse hook app and Symantec AV didn't bat an eye at it.

                N 1 Reply Last reply
                0
                • D Dan Neely

                  nueer wrote:

                  Goodluck with virus or whatevar. Worry is not needed Im sure, to be infected at my pc. I use McAfee.

                  Maybe. I've recently written a keyboard/mouse hook app and Symantec AV didn't bat an eye at it.

                  N Offline
                  N Offline
                  nueer
                  wrote on last edited by
                  #8

                  Yes... But why in heaven's name would one create a virus that runs on the .Net framework? I'm very naive when it comes to viruses and such, possibly because I've never been seriously affected by one... Does it ever make sense to write your virus using C# .Net? Unless it exploits the .Net Framework specifically... Sorry, thats off-topic. Hooking key-strokes is a handy little thingy. Can't see why someone would immediately assume it's a virus. Sorry for my poor grammar... boredom at work... it's a curse and a blessing.

                  D 1 Reply Last reply
                  0
                  • N nueer

                    Yes... But why in heaven's name would one create a virus that runs on the .Net framework? I'm very naive when it comes to viruses and such, possibly because I've never been seriously affected by one... Does it ever make sense to write your virus using C# .Net? Unless it exploits the .Net Framework specifically... Sorry, thats off-topic. Hooking key-strokes is a handy little thingy. Can't see why someone would immediately assume it's a virus. Sorry for my poor grammar... boredom at work... it's a curse and a blessing.

                    D Offline
                    D Offline
                    Dan Neely
                    wrote on last edited by
                    #9

                    nueer wrote:

                    Sorry, thats off-topic. Hooking key-strokes is a handy little thingy. Can't see why someone would immediately assume it's a virus.

                    Mainly I think it's a case of better safe than sorry. On anything viruslike the working rule here seems to be guilty until proven innocent. A legit sounding reason for wanting something is treated as proof of innocence, when combined and the assumption that a kidiot won't be able to come up with a legit sounding reason if cornered. I'm not sure it's the best solution but can't think of anything better myself.

                    1 Reply Last reply
                    0
                    • J J4amieC

                      Kiosks dont use traditional keyboards, so why would you need to deactivate keyboard input? Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

                      P Offline
                      P Offline
                      Prashant Gadhave
                      wrote on last edited by
                      #10

                      For some reasons my company is using traditional keyboards with all the keys.

                      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