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. Key Events

Key Events

Scheduled Pinned Locked Moved C#
tutorialquestionwindows-adminlinux
6 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.
  • K Offline
    K Offline
    kingletas
    wrote on last edited by
    #1

    Hey i am trying to create an application that takes control of the keyboard any time a key is pressed, however i don't know how to stop windows from executing the command for such key, example: If i pressed the windows key + E Key, this is the shortcut to bring windows explorer, i would like to display a menu inside the application, while this is running, but stop windows from bringing Windows Explorer, any ideas how to do that? And how can i write the registry if i know the key i want to write? Let's say, as an example, i have this key to write on the registry [HKEY_LOCAL_MACHINE]\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell = "explorer.exe", how could i write it completely without having to look for it first??? Thanks all!!!

    Luis E Tineo S

    L D 2 Replies Last reply
    0
    • K kingletas

      Hey i am trying to create an application that takes control of the keyboard any time a key is pressed, however i don't know how to stop windows from executing the command for such key, example: If i pressed the windows key + E Key, this is the shortcut to bring windows explorer, i would like to display a menu inside the application, while this is running, but stop windows from bringing Windows Explorer, any ideas how to do that? And how can i write the registry if i know the key i want to write? Let's say, as an example, i have this key to write on the registry [HKEY_LOCAL_MACHINE]\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell = "explorer.exe", how could i write it completely without having to look for it first??? Thanks all!!!

      Luis E Tineo S

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      kingletas wrote:

      Hey i am trying to create an application that takes control of the keyboard any time a key is pressed

      What do you want to do make it levitate?

      kingletas wrote:

      how could i write it completely without having to look for it first???

      Magic? Should be a breeze since you can perform levitation.

      K 1 Reply Last reply
      0
      • K kingletas

        Hey i am trying to create an application that takes control of the keyboard any time a key is pressed, however i don't know how to stop windows from executing the command for such key, example: If i pressed the windows key + E Key, this is the shortcut to bring windows explorer, i would like to display a menu inside the application, while this is running, but stop windows from bringing Windows Explorer, any ideas how to do that? And how can i write the registry if i know the key i want to write? Let's say, as an example, i have this key to write on the registry [HKEY_LOCAL_MACHINE]\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell = "explorer.exe", how could i write it completely without having to look for it first??? Thanks all!!!

        Luis E Tineo S

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Well, dispatching Windows+E to do something other than launch Explorer is frowned upon since that's a well-known key combination. Generally speaking, modifying the standard functionality of well-known key combinations and controls is frowned upon because it breaks the rules of a "consistant user experience" acrossed all applications. It can be done, but you have to implement a global keyboard hook. Search the articles for "keyboard hook" and you'll find what you're looking for.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        K 1 Reply Last reply
        0
        • L led mike

          kingletas wrote:

          Hey i am trying to create an application that takes control of the keyboard any time a key is pressed

          What do you want to do make it levitate?

          kingletas wrote:

          how could i write it completely without having to look for it first???

          Magic? Should be a breeze since you can perform levitation.

          K Offline
          K Offline
          kingletas
          wrote on last edited by
          #4

          led mike wrote:

          What do you want to do make it levitate?

          No just to avoid users from performing any actions while the application is running, that way basically i am creating a kiosk mode where the user only sees and uses my application... this is one of the few things i need to get it done.

          led mike wrote:

          Magic? Should be a breeze since you can perform levitation.

          I don't really like to do anything with the registry but I am planning on modifying certain key on the registry to avoid some keys to be execute by windows. I know that if Explorer is running all windows shortcuts are handle but if not there are not! any ideas!? PS: Why are you using the word magic all the time you want to be sarcastic?

          Luis E Tineo S

          L 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Well, dispatching Windows+E to do something other than launch Explorer is frowned upon since that's a well-known key combination. Generally speaking, modifying the standard functionality of well-known key combinations and controls is frowned upon because it breaks the rules of a "consistant user experience" acrossed all applications. It can be done, but you have to implement a global keyboard hook. Search the articles for "keyboard hook" and you'll find what you're looking for.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            K Offline
            K Offline
            kingletas
            wrote on last edited by
            #5

            Well basically the user won't see Windows at all... only the application. This is what happens: I have a touchscreen and a fingeprint reader. When the user is identified the application is enabled for the user to "vote" but he cannot do anything else. So i need to ensure that any key does anything rather than what i want it to do while the application is running but once it stops everything will be turn back to normal! Thanks... for the article i will look at it now!

            Luis E Tineo S

            1 Reply Last reply
            0
            • K kingletas

              led mike wrote:

              What do you want to do make it levitate?

              No just to avoid users from performing any actions while the application is running, that way basically i am creating a kiosk mode where the user only sees and uses my application... this is one of the few things i need to get it done.

              led mike wrote:

              Magic? Should be a breeze since you can perform levitation.

              I don't really like to do anything with the registry but I am planning on modifying certain key on the registry to avoid some keys to be execute by windows. I know that if Explorer is running all windows shortcuts are handle but if not there are not! any ideas!? PS: Why are you using the word magic all the time you want to be sarcastic?

              Luis E Tineo S

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #6

              kingletas wrote:

              you want to be sarcastic?

              I guess I am failing miserably eh?

              kingletas wrote:

              avoid users from performing any actions while the application is running

              Hmmm sounds like an interesting application to 'use', somehow I don't think what you wrote is actually what you mean. Anyway Dave's tip on a global keyboard hook is one way you can do that. There might be another involving the CBT mode but I'm not sure, also I don't have enough requirments from you to offer any certainties.

              kingletas wrote:

              I am planning on modifying certain key on the registry

              oops I misread your first post to say "if I don't know the key".... my bad :-O There are BCL classes for working with the registry. I don't remember offhand what namespace they are in but should be easy to find.

              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