Disable Alt+Tab and windows Keys?
-
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
-
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
-
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
-
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