Key Events
-
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
-
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
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.
-
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
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 -
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.
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
-
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, 2007Well 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
-
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
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.