Jump to content

How can i disable any keys from the keyboard‎ ?


Recommended Posts

HotKeySet ("{CTRL}", "dummyFunc")
HotKeySet ("{ALT}", "dummyFunc")

Func dummyFunc ()
EndFunc

That should do it ;)

Edit: Added ALT

Hi Fulano :D

I'm thank you very much for your interest and respond, God bless you :(

The start menu opens In spite of this code with left window button :) I'm beginner this forum so please help me.

King regards :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

HotKeySet ("+{E}", "ExitFunc") ; Shift+E
HotKeySet ("{LWin}", "dummyFunc") ; LeftWin

Func dummyFunc ()
EndFunc

Func ExitFunc ()
    MsgBox (0, "", "Bye!")
    Exit
EndFunc

$Form1 = GUICreate("Form1", 405, 294, 302, 240, BitOR($WS_MAXIMIZE,$WS_POPUP), $WS_EX_TOPMOST)
GUISetState(@SW_SHOW)
GUISetState(@SW_MAXIMIZE)
WinSetTrans("Form1", "", 1)

While 1
    WEnd
Link to comment
Share on other sites

From the documentation (emphasis added)

The following hotkeys cannot be set:

Ctrl+Alt+DeleteIt is reserved by WindowsF12It is also reserved by Windows, according to its API.NumPad's Enter KeyInstead, use {Enter} which captures both Enter keys on the keyboard.Win+B,D,E,F,L,M,R,U; and Win+Shift+MThese are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above.Alt, Ctrl, Shift, WinThese are the modifier keys themselves!OtherAny global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'.

Sorry, to block the windows key you'll need to find something else.

Edit: Looks like quoting it killed the formating, but you can find it here.

Edited by Fulano

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

AutoIt is rather well behaved in this regard, you'd have to find a program that didn't mind stepping on the Windows API ::shrug::

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

#include <BlockInputEx.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

;================== CLASSes usage Example ==================

HotKeySet("{ESC}", "_Quit");This will trigger an exit

;Here we block Numeric keyboard keys, "Test" string (every char in this group), and UP / DOWN arrow keys.
_BlockInputEx(3, "", "[:NUMBER:]|[Test]|{LWin}|{DOWN}")

;This is only for testing, so if anything go wrong, the script will exit after 10 seconds.
;AdlibEnable("_Quit", 10000)

Func _Quit()
    Exit
EndFunc




HotKeySet ("+{E}", "ExitFunc") ; Shift+E
HotKeySet ("{LWin}", "dummyFunc") ; LeftWin

Func dummyFunc ()
EndFunc

Func ExitFunc ()
    MsgBox (0, "", "Bye!")
    Exit
EndFunc

$Form1 = GUICreate("Form1", 405, 294, 302, 240, BitOR($WS_MAXIMIZE,$WS_POPUP), $WS_EX_TOPMOST)
GUISetState(@SW_SHOW)
GUISetState(@SW_MAXIMIZE)
WinSetTrans("Form1", "", 1)

While 1
    WEnd

Solution : http://www.autoitscript.com/forum/index.php?showtopic=87735

Best regards :(

Edited by maxrealqnx
Link to comment
Share on other sites

#include <String.au3>
#include <BlockInputEx.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

_BlockInputEx(3, "", "[:NUMBER:]|[Test]|{LWin}|{LALT}{TAB}{ALT}")

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableTaskMgr", "REG_DWORD", "1")

#Region ### START Koda GUI section ### Form=
;$Form1 = GUICreate("Form1", 405, 294, 302, 218, BitOR($WS_MINIMIZEBOX,$WS_MAXIMIZE,$WS_POPUP,$WS_GROUP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Form1 = GUICreate("Form1", 405, 294, 302, 218, BitOR($WS_MINIMIZEBOX,$WS_MAXIMIZE,$WS_POPUP,$WS_GROUP))
GUISetState(@SW_SHOW)
GUISetState(@SW_LOCK)
#EndRegion ### END Koda GUI section ###


#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 280, 100, -1, -1, BitOR($WS_THICKFRAME,$WS_POPUP,$WS_GROUP,$WS_TABSTOP), BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$PasswordEdit = GUICtrlCreateInput("", 8, 32, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17, 0)
GUISetState(@SW_SHOW)
;GUISetState(@SW_DISABLE)
#EndRegion ### END Koda GUI section ###
WinSetTrans("Form1", "", 1)

If FileExists (@SystemDir & "\vistape.cfg") Then
$Level = IniRead(@SystemDir & "\vistape.cfg", "main", "PLevel", "")
$var = IniRead(@SystemDir & "\vistape.cfg", "main", "Password", "")
$UnEncrypt = _StringEncrypt(0, $var, "bootland", $Level)
EndIf
;
If Not FileExists (@SystemDir & "\vistape.cfg") Then
$var = "0FCA9E548F2EA131C067A78F32FE5737A2FD50CEF546DA2BF0641A920136A03C30024668" ; = QnxMaxQnx
$Level = "2"
$UnEncrypt = _StringEncrypt(0, $var, "bootland", $Level)
EndIf

Global $EntrOK = "NO"

While 1
    HotKeySet("{Enter}", "Entr")
    ;
    Select
    Case $EntrOK  = "OK"
        If GuiCtrlRead ($PasswordEdit) = $UnEncrypt Then
            Global $EntrOK = "NO"
            HotKeySet("{Enter}")
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableTaskMgr", "REG_DWORD", "0")
            Exit
                ;   
            ;GUIDelete ($Form1)
            ;GUIDelete ($Form2)
            ;Return
        Else
            GUISetState(@SW_HIDE)
            HotKeySet("{Enter}")
            Global $EntrOK = "NO"
            MsgBox(0,"Access Denied", "Sorry, the password you entered is incorrect.")
            GUISetState(@SW_SHOW)
            EndIf
    EndSelect
    ;
    
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func dummyFunc ()
EndFunc

Func Entr()
    Global $EntrOK = "OK"
EndFunc

Hi again my friends :)

How can i disable re-sizable of the password window with mouse cursor ?

Best regards :(

post-36686-12696802655939_thumb.jpg

Link to comment
Share on other sites

VistaPE Leopard Lock v1

#include <String.au3>
#include <BlockInputEx.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

_BlockInputEx(3, "", "{ESC}|{TAB}|{LWin}|{RWin}|{LALT}|{RALT}|{RSHIFT}|{LSHIFT}|{RCTRL}|{LCTRL}|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}")
;
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableTaskMgr", "REG_DWORD", "1")
;
Global $Form1 = GUICreate("Form1", 405, 294, 302, 218, BitOR($WS_MINIMIZEBOX,$WS_MAXIMIZE,$WS_POPUP,$WS_GROUP))
GUISetState(@SW_SHOW)
GUISetState(@SW_DISABLE)
WinSetTrans("Form1", "", 1)
;
Global $Form2 = GUICreate("VistaPE Leopard Lock", 280, 100, -1, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
Global $PasswordEdit = GUICtrlCreateInput("", 8, 32, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
Global $EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17, 0)
Global $Lck1 = GUICtrlCreateIcon("shell32.dll", 45, 243, 29, 24, 24)
GUICtrlSetCursor (-1, 0)
GUICtrlSetTip($Lck1, "Enter", "", 1, 1)
GUISetBkColor(0xFFFFFF)
GUISetState(@SW_SHOW)
;
If FileExists (@SystemDir & "\vistape.cfg") Then
Global $Level = IniRead(@SystemDir & "\vistape.cfg", "main", "PLevel", "")
Global $var = IniRead(@SystemDir & "\vistape.cfg", "main", "Password", "")
Global $UnEncrypt = _StringEncrypt(0, $var, "bootland", $Level)
EndIf
;
If Not FileExists (@SystemDir & "\vistape.cfg") Then
Global $var = "0FCA9E548F2EA131C067A78F32FE5737A2FD50CEF546DA2BF0641A920136A03C30024668" ; = QnxMaxQnx
Global $Level = "2"
Global $UnEncrypt = _StringEncrypt(0, $var, "bootland", $Level)
EndIf
;
Global $EntrOK = "NO"
;
While 1
    HotKeySet("{Enter}", "Entr")
    ;
    Select
    Case $EntrOK  = "OK"
        If GuiCtrlRead ($PasswordEdit) = $UnEncrypt Then
            Global $EntrOK = "NO"
            HotKeySet("{Enter}")
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableTaskMgr", "REG_DWORD", "0")
            Exit
                ;   
            ;GUIDelete ($Form1)
            ;GUIDelete ($Form2)
            ;Return
        Else
            GUISetState(@SW_HIDE)
            HotKeySet("{Enter}")            
            Global $EntrOK = "NO"
            ReFrom()
            EndIf
    EndSelect
    ;
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Lck1
        If GuiCtrlRead ($PasswordEdit) = $UnEncrypt Then
            HotKeySet("{Enter}")
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableTaskMgr", "REG_DWORD", "0")
            Exit
                ;   
            ;GUIDelete ($Form1)
            ;GUIDelete ($Form2)
            ;Return
        Else
            GUISetState(@SW_HIDE)
            HotKeySet("{Enter}")            
            ReFrom()
            EndIf
    EndSwitch
WEnd
;
Func dummyFunc ()
EndFunc
;
Func Entr()
    Global $EntrOK = "OK"
EndFunc
;
Func ReFrom()
GUIDelete ($Form1)
Global $Form1 = GUICreate("Form1", 405, 294, 302, 218, BitOR($WS_MINIMIZEBOX,$WS_MAXIMIZE,$WS_POPUP,$WS_GROUP))
GUISetState(@SW_SHOW)
GUISetState(@SW_DISABLE)
WinSetTrans("Form1", "", 1)
;
MsgBox(0,"Access Denied", "Sorry, the password you entered is incorrect.")
;
GUIDelete ($Form1)
Global $Form1 = GUICreate("Form1", 405, 294, 302, 218, BitOR($WS_MINIMIZEBOX,$WS_MAXIMIZE,$WS_POPUP,$WS_GROUP))
GUISetState(@SW_SHOW)
GUISetState(@SW_DISABLE)
WinSetTrans("Form1", "", 1)
;
GUIDelete ($Form2)
GUICtrlDelete ($Lck1)
GUICtrlDelete ($PasswordEdit)
GUICtrlDelete ($EnterPassLabel)
Global $Form2 = GUICreate("VistaPE Leopard Lock", 280, 100, -1, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
Global $PasswordEdit = GUICtrlCreateInput("", 8, 32, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
Global $EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17, 0)
Global $Lck1 = GUICtrlCreateIcon("shell32.dll", 45, 243, 29, 24, 24)
GUICtrlSetCursor (-1, 0)
GUICtrlSetTip($Lck1, "Enter", "", 1, 1)
GUISetBkColor(0xFFFFFF)
GUISetState(@SW_SHOW)
GUISetState(@SW_RESTORE)
EndFunc
Edited by maxrealqnx
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...