Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Disable Alt+Tab and windows Keys?

Disable Alt+Tab and windows Keys?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    ghost181
    wrote on last edited by
    #1

    Hi, may i know how to disable alt+tab and windows key for my application? ghost

    C H 2 Replies Last reply
    0
    • G ghost181

      Hi, may i know how to disable alt+tab and windows key for my application? ghost

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      If that's possible at all, it requires a system wide keyboard hook. There are articles on CP on how to do this, but I'm not sure if it will work. If not, then it's not possible.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      1 Reply Last reply
      0
      • G ghost181

        Hi, may i know how to disable alt+tab and windows key for my application? ghost

        H Offline
        H Offline
        hannesHTG
        wrote on last edited by
        #3

        Yes It is possible. You will definitely need a System Wide Hook. Which version of VB are you using ¿ In VB 6, you will need to use the SystemParametersInfo API. You can implement it like this : Private Declare Function SystemParametersInfo _ Lib "user32" Alias "SystemParametersInfoA" _ (ByVal uAction As Long, ByVal uParam As Long, _ ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long 'API Function to disable keys Private Sub DisableCtrlAltDel(bDisabled As Boolean) ' Disables Control Alt Delete Breaking 'as well as Ctrl-Escape Dim X As Long X = SystemParametersInfo(97, bDisabled, CStr(1), 0) End Sub Then the call to the Above function : Private Sub Form_Load() Call DisableCtrlAltDel(True) 'disable the system keys End Sub 'Remember to Enable the system keys again, when the program exits, otherwise it will remain blocked. To re enable them, Just supply False to the DisableCtrlAltDel function. With VB.NET it is a bit more difficult. Luckily there is a component called mclhotkey, which will give you the functionality of a System Wide Hook. You can find that component here : http://www.codeproject.com/useritems/mclhotkey.asp?print=true[^] Hope that helps! H T G

        G 2 Replies Last reply
        0
        • H hannesHTG

          Yes It is possible. You will definitely need a System Wide Hook. Which version of VB are you using ¿ In VB 6, you will need to use the SystemParametersInfo API. You can implement it like this : Private Declare Function SystemParametersInfo _ Lib "user32" Alias "SystemParametersInfoA" _ (ByVal uAction As Long, ByVal uParam As Long, _ ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long 'API Function to disable keys Private Sub DisableCtrlAltDel(bDisabled As Boolean) ' Disables Control Alt Delete Breaking 'as well as Ctrl-Escape Dim X As Long X = SystemParametersInfo(97, bDisabled, CStr(1), 0) End Sub Then the call to the Above function : Private Sub Form_Load() Call DisableCtrlAltDel(True) 'disable the system keys End Sub 'Remember to Enable the system keys again, when the program exits, otherwise it will remain blocked. To re enable them, Just supply False to the DisableCtrlAltDel function. With VB.NET it is a bit more difficult. Luckily there is a component called mclhotkey, which will give you the functionality of a System Wide Hook. You can find that component here : http://www.codeproject.com/useritems/mclhotkey.asp?print=true[^] Hope that helps! H T G

          G Offline
          G Offline
          ghost181
          wrote on last edited by
          #4

          Hi, Sorry forget to tell you what version i am using. I am using vb.net 2005 to develop a windows form.

          1 Reply Last reply
          0
          • H hannesHTG

            Yes It is possible. You will definitely need a System Wide Hook. Which version of VB are you using ¿ In VB 6, you will need to use the SystemParametersInfo API. You can implement it like this : Private Declare Function SystemParametersInfo _ Lib "user32" Alias "SystemParametersInfoA" _ (ByVal uAction As Long, ByVal uParam As Long, _ ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long 'API Function to disable keys Private Sub DisableCtrlAltDel(bDisabled As Boolean) ' Disables Control Alt Delete Breaking 'as well as Ctrl-Escape Dim X As Long X = SystemParametersInfo(97, bDisabled, CStr(1), 0) End Sub Then the call to the Above function : Private Sub Form_Load() Call DisableCtrlAltDel(True) 'disable the system keys End Sub 'Remember to Enable the system keys again, when the program exits, otherwise it will remain blocked. To re enable them, Just supply False to the DisableCtrlAltDel function. With VB.NET it is a bit more difficult. Luckily there is a component called mclhotkey, which will give you the functionality of a System Wide Hook. You can find that component here : http://www.codeproject.com/useritems/mclhotkey.asp?print=true[^] Hope that helps! H T G

            G Offline
            G Offline
            ghost181
            wrote on last edited by
            #5

            Hi, I find the solution already. thx :-D

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups