I want to develop a cyber cafe management software in Visual Basic 6. so i need to disable/enable the WIN key(middle key of Ctrl and Alt). please help me.
I can disable/enable the remain keys. Waiting for good comments.
Thanks in advance.
Printable View
I want to develop a cyber cafe management software in Visual Basic 6. so i need to disable/enable the WIN key(middle key of Ctrl and Alt). please help me.
I can disable/enable the remain keys. Waiting for good comments.
Thanks in advance.
Well, im just starting out on any kind of VB, but having experience in Liberty BASIC, you probably have to find the virtual key code for the Win key. Try doing a Google search for it.
Handle the keyup event.
Put a breakpoint in the event and start your application (you must have keypreview set to true on the form properties). Now press the winkey.
Your breakpoint will hit. Check the value of "e" (KeyEventArgs).
Now you can create something like.
If e.keyvalue (or e.keycode) = (The value of the win key)
do nothing
else
do something
Just saw you are using vb6.
The example is for .net.
there are a couple of recent threads on this for use in vb6. This gets asked all the time because the windows key will case some games to crash to desktop if you hit it while playing accidently (easy if the ctrl is the fire button).
Either search the forums for "Block ctrl-esc" or something like that (because that's what the windows key really is) or study up on making a keyboard hook. Your app needs to hook the keyboard so all keypresses are filtered through it. Then it returns back to the OS ones it allows. Basically your sub would get called with each keypress.