Eingabe bis zur Eingabe von Passwort blocken?

  • Ich hab das Script mal etwas erweitert und mit diesem Scirpt kombinier: [ offen ] Windows Taste deaktivieren , so dass auch die Win-Taste abgefangen wird, denn zumindestens unter Win7 wird diese sonst nicht:

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #include <StructureConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $hHookKeyboard, $pStub_KeyProc
    Global Const $VK_WIN_LEFT = 0x5B
    Global Const $VK_WIN_RIGHT = 0x5C
    Global Const $Key_NONE = 0x0

    [/autoit] [autoit][/autoit] [autoit]

    $pStub_KeyProc = DllCallbackRegister("_KeyProc", "int", "int;ptr;ptr")
    $hHookKeyboard = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($pStub_KeyProc), _WinAPI_GetModuleHandle(0), 0)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("winlockdll.dll", "int", "Desktop_Show_Hide", "int", 0)
    DllCall("winlockdll.dll", "int", "Taskbar_Show_Hide", "int", 0)
    DllCall("winlockdll.dll", "int", "TaskSwitching_Enable_Disable", "int", 0)
    DllCall("winlockdll.dll", "int", "TaskManager_Enable_Disable", "int", 0)
    $gui = GUICreate("", @DesktopWidth + 5, @DesktopHeight + 5, -5, -5, 0x80000000, 0x00000080)
    GUISetBkColor(0x0)
    WinSetOnTop($gui, "", 1)
    WinSetTrans($gui, "", 25)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 50)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 75)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 100)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 125)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 150)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 180)
    GUISetState()
    Sleep(100)
    $popup = GUICreate("Computer gesperrt", 300, 300, -1, -1, "0x80000000", $WS_EX_TOPMOST)

    [/autoit] [autoit][/autoit] [autoit]

    $id_progress1 = GUICtrlCreateProgress(0, 0, 300, 30, -1, -1)
    $id_progress2 = GUICtrlCreateProgress(0, 270, 300, 30, -1, -1)
    $id_pic3 = GUICtrlCreatePic("Locked.gif", 0, 30, 100, 100, -1, -1)
    $id_pic4 = GUICtrlCreatePic("pw.gif", 100, 30, 200, 100, -1, -1)
    $id_label5 = GUICtrlCreateLabel("Passwort eingeben:", 10, 174, 101, 13, -1, -1)
    $Input_1 = GUICtrlCreateInput("", 120, 170, 170, 22, -1, -1)
    $Button_2 = GUICtrlCreateButton("ENTSPERREN", 65, 226, 159, 34, -1, -1)
    GUISetState(@SW_SHOW)
    While 1
    If Not WinActive("Computer gesperrt") Then
    WinActivate("Computer gesperrt")
    WinClose("Task-Manager")
    EndIf
    $msg2 = GUIGetMsg()
    Select
    Case $msg2 = $Button_2
    If GUICtrlRead($Input_1) = "passwort" Then
    ExitLoop
    EndIf
    EndSelect
    WEnd
    GUIDelete($popup)

    [/autoit] [autoit][/autoit] [autoit]

    Sleep(300)
    WinSetTrans($gui, "", 125)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 100)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 50)
    GUISetState()
    Sleep(100)
    DllCall("winlockdll.dll", "int", "Desktop_Show_Hide", "int", 1)
    DllCall("winlockdll.dll", "int", "Taskbar_Show_Hide", "int", 1)
    DllCall("winlockdll.dll", "int", "TaskSwitching_Enable_Disable", "int", 1)
    DllCall("winlockdll.dll", "int", "TaskManager_Enable_Disable", "int", 1)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func OnAutoITExit()
    DllCallbackFree($pStub_KeyProc)
    _WinAPI_UnhookWindowsHookEx($hHookKeyboard)
    EndFunc ;==>OnAutoITExit

    [/autoit] [autoit][/autoit] [autoit]

    Func _KeyProc($nCode, $wParam, $lParam)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)
    Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
    Local $vkCode = DllStructGetData($tKEYHOOKS, "vkCode")
    If ($wParam = $WM_KEYDOWN) And ($vkCode = $VK_WIN_LEFT Or $vkCode = $VK_WIN_RIGHT) Then
    DllCall('user32.dll', 'int', 'keybd_event', 'int', $Key_NONE, 'int', 0, 'int', 0, 'ptr', 0)
    Return -1
    EndIf
    Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)
    EndFunc ;==>_KeyProc

    [/autoit]

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

    Einmal editiert, zuletzt von chip (7. Oktober 2010 um 08:09)

  • Zunächst einmal, Taskmanager und Zugriff aus die Registrierung sperren

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

    soll das ganze Rückgängig gemacht werden, einfach die 1 durch eine 0 ersetzen.

    Den Rest muss ich noch raussuchen.

  • NA besten Dank. Da ist ja einiges zusammengekommen...

    Werd´s mal probieren. Ach ja übrigens, wie kann ich eine GUI Transparent erscheinen lassen? Also so wie unter Windows Vista die Fenster aussehen....

    :thumbup:

  • Du hast die das Script das ich oben gepostet habe nicht wirklich angeschaut oder? Weil dann wüsstest es das es mit WinSetTrans geht.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.