|
-
Nov 29th, 2007, 02:14 PM
#1
Thread Starter
New Member
Enable/disable win key
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.
-
Dec 6th, 2007, 06:57 PM
#2
New Member
Re: Enable/disable win key
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.
-
Dec 7th, 2007, 07:54 AM
#3
Re: Enable/disable win key
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
-
Dec 7th, 2007, 07:56 AM
#4
Re: Enable/disable win key
Just saw you are using vb6.
The example is for .net.
-
Dec 11th, 2007, 02:01 PM
#5
Re: Enable/disable win key
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|