Results 1 to 6 of 6

Thread: Disable Windows Buttons?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    546

    Disable Windows Buttons?

    Is it possible to disable the windows buttons on the keyboard other than modifying the registry?

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Disable Windows Buttons?

    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:
    VB Code:
    1. SetSystemWideKey(WINDOWS_KEY)
    2.  
    3. CallBack Sub HotKey_Pressed()
    4. RaiseEvent Form_KeyUp
    5. End Sub
    6.  
    7. Sub Form_KeyUp(arguments)
    8. KeyCode = 0
    9. End Sub
    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.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    546

    Re: Disable Windows Buttons?

    Can you give me a little more detail? Is that all of the code?

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Disable Windows Buttons?

    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

    Visual Studio 6, Visual Studio.NET 2005, MASM

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    546

    Re: Disable Windows Buttons?

    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:
    1. Dim WSHShell
    2. Set WSHShell = CreateObject("WScript.Shell")
    3.  
    4. ThePath = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout\Scancode Map"
    5.  
    6. 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:
    1. Dim WSHShell
    2. Set WSHShell = CreateObject("WScript.Shell")
    3.  
    4. ThePath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWinKeys"
    5.  
    6. WSHShell.regwrite ThePath, 1, " REG_DWORD"

    I would use this, but I hate how you have to restart for changes to take effect.

  6. #6
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Disable Windows Buttons?

    There is no other way I know of. Perhaps searching google will return more results.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

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