Results 1 to 10 of 10

Thread: [RESOLVED] windows hotkeys

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Resolved [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

  2. #2
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: windows hotkeys

    This is from the API-Guide. It makes and then removes a hotkey

    VB Code:
    1. Private Const MOD_ALT = &H1
    2. Private Const MOD_CONTROL = &H2
    3. Private Const MOD_SHIFT = &H4
    4. Private Const PM_REMOVE = &H1
    5. Private Const WM_HOTKEY = &H312
    6. Private Type POINTAPI
    7.     x As Long
    8.     y As Long
    9. End Type
    10. Private Type Msg
    11.     hWnd As Long
    12.     Message As Long
    13.     wParam As Long
    14.     lParam As Long
    15.     time As Long
    16.     pt As POINTAPI
    17. End Type
    18. Private Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
    19. Private Declare Function UnregisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long) As Long
    20. 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
    21. Private Declare Function WaitMessage Lib "user32" () As Long
    22. Private bCancel As Boolean
    23. Private Sub ProcessMessages()
    24.     Dim Message As Msg
    25.     'loop until bCancel is set to True
    26.     Do While Not bCancel
    27.         'wait for a message
    28.         WaitMessage
    29.         'check if it's a HOTKEY-message
    30.         If PeekMessage(Message, Me.hWnd, WM_HOTKEY, WM_HOTKEY, PM_REMOVE) Then
    31.             'minimize the form
    32.             WindowState = vbMinimized
    33.         End If
    34.         'let the operating system process other events
    35.         DoEvents
    36.     Loop
    37. End Sub
    38. Private Sub Form_Load()
    39.     'KPD-Team 2000
    40.     'URL: [url]http://www.allapi.net/[/url]
    41.     'E-Mail: [email][email protected][/email]
    42.     Dim ret As Long
    43.     bCancel = False
    44.     'register the Ctrl-F hotkey
    45.     ret = RegisterHotKey(Me.hWnd, &HBFFF&, MOD_CONTROL, vbKeyF)
    46.     'show some information
    47.     Me.AutoRedraw = True
    48.     Me.Print "Press CTRL-F to minimize this form"
    49.     'show the form and
    50.     Show
    51.     'process the Hotkey messages
    52.     ProcessMessages
    53. End Sub
    54. Private Sub Form_Unload(Cancel As Integer)
    55.     bCancel = True
    56.     'unregister hotkey
    57.     Call UnregisterHotKey(Me.hWnd, &HBFFF&)
    58. End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Question 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

  4. #4
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    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?

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: windows hotkeys

    Quote 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?

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Question Re: windows hotkeys

    I am making a parental control program to stop my kids from messing up my computer.

  7. #7
    New Member
    Join Date
    Nov 2006
    Posts
    9

    Re: windows hotkeys

    delete me
    Last edited by Kolem; May 19th, 2010 at 09:50 AM.

  8. #8
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: windows hotkeys

    F1 is a default Help key... It'd be pretty highly discouraged if you reassigned it...

  9. #9
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    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________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Re: [RESOLVED] windows hotkeys

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width