|
-
Sep 29th, 2006, 09:19 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] windows hotkeys
i have searched and searched the internet for a code that disables the windows hotkeys.
now i have give up, i have even tried writing one but i am not advanced in vb.
I think there is a code because im sure that i have seen it, but i cant find it.
If anybody knows where i can find this code please post the link.
Thanks
chris1990
-
Sep 29th, 2006, 09:33 AM
#2
Re: windows hotkeys
This is from the API-Guide. It makes and then removes a hotkey
VB Code:
Private Const MOD_ALT = &H1
Private Const MOD_CONTROL = &H2
Private Const MOD_SHIFT = &H4
Private Const PM_REMOVE = &H1
Private Const WM_HOTKEY = &H312
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type Msg
hWnd As Long
Message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
Private Declare Function UnregisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long) As Long
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As Msg, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
Private Declare Function WaitMessage Lib "user32" () As Long
Private bCancel As Boolean
Private Sub ProcessMessages()
Dim Message As Msg
'loop until bCancel is set to True
Do While Not bCancel
'wait for a message
WaitMessage
'check if it's a HOTKEY-message
If PeekMessage(Message, Me.hWnd, WM_HOTKEY, WM_HOTKEY, PM_REMOVE) Then
'minimize the form
WindowState = vbMinimized
End If
'let the operating system process other events
DoEvents
Loop
End Sub
Private Sub Form_Load()
'KPD-Team 2000
'URL: [url]http://www.allapi.net/[/url]
Dim ret As Long
bCancel = False
'register the Ctrl-F hotkey
ret = RegisterHotKey(Me.hWnd, &HBFFF&, MOD_CONTROL, vbKeyF)
'show some information
Me.AutoRedraw = True
Me.Print "Press CTRL-F to minimize this form"
'show the form and
Show
'process the Hotkey messages
ProcessMessages
End Sub
Private Sub Form_Unload(Cancel As Integer)
bCancel = True
'unregister hotkey
Call UnregisterHotKey(Me.hWnd, &HBFFF&)
End Sub
-
Sep 29th, 2006, 09:49 AM
#3
Thread Starter
Hyperactive Member
Re: windows hotkeys
does this disable the windows hot key though e.g
Win+L - lock pc
Win+R - run
Win+H - help
Win+E - Explorer
Win - start menu
-
Sep 29th, 2006, 10:02 AM
#4
Re: windows hotkeys
I'm not sure you can disable the win key. Maybe there is a better solution for your problem. Why do you need to disable them?
-
Sep 29th, 2006, 10:04 AM
#5
Re: windows hotkeys
 Originally Posted by chris1990
does this disable the windows hot key though e.g
Win+L - lock pc
Win+R - run
Win+H - help
Win+E - Explorer
Win - start menu
No, and across the board you should not disable those keys. In fact, I would consider that to be intrusive and virus like.
On the other hand, if you are sitting up a single, specific, PC to be used in a public kiosk where you don't know who will be actually using it, I can see where it would be beneficial to be more restrictive on that particular machine.
What is your end goal for wanting to disable these functions?
-
Oct 13th, 2006, 04:32 AM
#6
Thread Starter
Hyperactive Member
Re: windows hotkeys
I am making a parental control program to stop my kids from messing up my computer.
-
Nov 11th, 2006, 10:02 AM
#7
New Member
Last edited by Kolem; May 19th, 2010 at 09:50 AM.
-
Nov 11th, 2006, 10:07 AM
#8
Re: windows hotkeys
F1 is a default Help key... It'd be pretty highly discouraged if you reassigned it...
-
Nov 11th, 2006, 11:30 AM
#9
Re: windows hotkeys
Goto
hklm\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Add a new reg_dword key as "NoWinKeys" .Put the value as 0 to disable and 1 to enable.
ps:This is not a hack but a registry tweak ,so no harm in posting it
__________________
________________0îîî___
___îîî0________(___)____
__(___)_________) _/_____
___\_ (_________(_/______
____\_)_________________
-
Nov 13th, 2006, 12:46 PM
#10
Thread Starter
Hyperactive Member
Re: [RESOLVED] windows hotkeys
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
|