Is it possible to disable the windows buttons on the keyboard other than modifying the registry?
Printable View
Is it possible to disable the windows buttons on the keyboard other than modifying the registry?
You could set up a System Wide Hotkey which activates your program, then use RaiseEvent to raise the KeyUp event of your application, and set KeyCode to 0, something similar to this pseudo-code:
Not too sure if it would work, but its worth a shot. Other than that, I'd say the registry would be your best bet.VB Code:
SetSystemWideKey(WINDOWS_KEY) CallBack Sub HotKey_Pressed() RaiseEvent Form_KeyUp End Sub Sub Form_KeyUp(arguments) KeyCode = 0 End Sub
chem
Can you give me a little more detail? Is that all of the code?
No no, Pseudo-code, means its a basic layout, not the actual code. You will have to look up how to set Global HotKeys (System Wide Hotkeys). Try searching the forums using the Forum Search area. I'm not even sure this would work. Have you tried Google?
chem
Is it possible to use the registry codes without having to restart for changes to take effect? Because here are the codes I have:
Disable the Windows Key: (Windows NT/2000/XP)
VB Code:
Dim WSHShell Set WSHShell = CreateObject("WScript.Shell") ThePath = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout\Scancode Map" WSHShell.regwrite ThePath, 00 00 00 00 00 00 00 00 03 00 00 00 00 00 5B E0 00 00 5C E0 00 00 00 00, "REG_BINARY"
Disable the Windows HotKeys: (All Windows)
VB Code:
Dim WSHShell Set WSHShell = CreateObject("WScript.Shell") ThePath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWinKeys" WSHShell.regwrite ThePath, 1, " REG_DWORD"
I would use this, but I hate how you have to restart for changes to take effect.
There is no other way I know of. Perhaps searching google will return more results.
chem