Search the Community
Showing results for tags 'kiosk'.
-
Hello i am new here and this is my first thread in this script i used some code snippets from forum. I do not remember who these belonged to. Disabled ALT+F4 ALT+TAB TASK MANAGER LOCKING WINDOWS deleted items from ctrl+alt+delete screen (Lock Computer,Switch User,Sign Out,Chance a password,Task Manager) CTRL+ALT+DELETE (how ?) firstly we are disabled locking computer RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableLockWorkstation',"REG_DWORD",0x00000001) and then ctrl+alt+delete pressed IsDesktopLocked() triggered. we are calling Run("rundll32.exe user32.dll,LockWorkStation") command with checking if $blockctrlaltdel = 1 statements. then it return us to kiosk screen, because we are disabled locking computer. Func IsDesktopLocked() Local $hDesktop Local $iRet Local $iRC Local $sMsg Local Const $DESKTOP_SWITCHDESKTOP = 0x100 $hDesktop = DllCall("User32.dll", "int", "OpenDesktop", "str", "Default", "int", 0, "int", 0, "int", $DESKTOP_SWITCHDESKTOP) $iRet = DllCall("User32.dll", "int", "SwitchDesktop", "int", $hDesktop[0]) If IsArray($iRet) Then If $iRet[0] = 0 Then if $blockctrlaltdel = 1 Then Run("rundll32.exe user32.dll,LockWorkStation") EndIf $iRC = 1 ElseIf $iRet[0] = 1 Then $iRC = 0 EndIf Else EndIf DllCall("User32.dll", "int", "CloseDesktop", "int", $hDesktop[0]);<-- handle returned by "OpenDesktop" ;$iRet = DllCall("User32.dll", "int", "CloseDesktop", "int", $iRet[0]) Return ($iRC) EndFunc ;==>IsDesktopLocked maybe this blocked to lock computer when rdp session closed. i havent tried and This script needed to Google chrome and "WinLockDll.dll" to work. FULL SCRIPT #include <WinAPI.au3> #include <FontConstants.au3> #include <GUIConstants.au3> Opt('GUIOnEventMode', 1) Opt("TrayAutoPause", 0) HotKeySet("{ESCAPE}","_EXIT") ;~ $sFilePath = "D:\kiosk\" local $Form1,$blockctrlaltdel Global Const $VK_F4 = 0x73 Global $winlockdll = DllOpen(@ScriptDir&"\WinLockDll.dll") kullanimkapat() #region ; WinEventHook Global Const $EVENT_OPEN_DESKTOP_CHANGED = 0x0020 $h_DLL_User32 = DllOpen("User32.dll") $h_WinEventHook_Proc = DllCallbackRegister("_WinEventHook_Proc", "none", "hwnd;int;hwnd;long;long;int;int") If @error Then ConsoleWrite("Error DllCallbackRegister(_WinEventHook_Proc) did not succeed. FFH will exit now.") Exit EndIf $h_Hook = _WinEventHook_Set(0x0020, 0x0020, $h_DLL_User32) If @error Then ConsoleWrite("Error _WinEventHook_Set() did not succeed. FFH will exit now.") Exit EndIf OnAutoItExitRegister("_WinEventHook_UnSet") #endregion ; WinEventHook Global $winlockdll = DllOpen(@ScriptDir&"\WinLockDll.dll") Func kullanimkapat() $blockctrlaltdel = 1 Global $hHookProc = DllCallbackRegister("_KeyboardProc", "long", "int;wparam;lparam") Global $hHookKeyboard = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hHookProc), _WinAPI_GetModuleHandle(0), 0) Global $hSysTray_Handle = DllCall("user32.dll", "HWND", "FindWindow", "str", "Shell_TrayWnd", "str", "") _WinAPI_ShellChangeNotify($SHCNE_ASSOCCHANGED, 0, 0, 0) _SendMessage($hSysTray_Handle[0], 0x5B4, 0, 0) DllCall($winlockdll, "Int", "Keys_Enable_Disable ", "Int", "1") DllCall($winlockdll, "Int", "TaskManager_Enable_Disable", "Int", "0") DllCall($winlockdll, "Int", "TaskSwitching_Enable_Disable", "Int", "0") DllCall($winlockdll, "Int", "Keys_Enable_Disable", "Int", "1") RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableChangePassword',"REG_DWORD",0x00000001) RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System', 'HideFastUserSwitching', "REG_DWORD",0x00000001) RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer', 'NoLogoff',"REG_DWORD",0x00000001) RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer', 'NoClose',"REG_DWORD",0x00000001) RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableTaskMgr',"REG_DWORD",0x00000001) RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableLockWorkstation',"REG_DWORD",0x00000001) FileDelete ( @LocalAppDataDir&"\Google\Chrome\User Data\Default\Preferences" ) ;~ Local $hFileOpen = FileOpen($sFilePath,BitOR(8,2)) ;~ FileWrite($hFileOpen,'<!DOCTYPE html><meta http-equiv="refresh" content="30"><html><head><script type="text/javascript">function disableselect(e){return!1}function reEnable(){return!0}document.onselectstart=new Function("return false"),document.oncontextmenu=new Function("return false"),window.sidebar&&(document.onmousedown=disableselect,document.onclick=reEnable);</script><style>#masano{top:50%;left:50%;width:250px;height:250px;margin-top:-125px;margin-left:-125px;border:1px solid red;background-color:red;position:fixed;font:normal 200px Calibri;line-height:250px;text-align:center;color:white}</style><title>*</title></head><body><div id="masano">'&@ComputerName&'</div></body></html>"') ;~ FileClose($hFileOpen);kiosk html writed Run("taskkill /im chrome.exe /f /t") Sleep(3000) ;~ Run(@HomeDrive&"\Program Files (x86)\Google\Chrome\Application\chrome.exe --kiosk "&$sFilePath) Run(@HomeDrive&"\Program Files (x86)\Google\Chrome\Application\chrome.exe --kiosk https://www.autoitscript.com/autoit3/files/graphics/autoit_10_wall_1920x1200.jpg") WinMinimizeAll() Global $hSplash = GuiCreate("", @DesktopWidth+5, @DesktopHeight+5, -5, -5,$WS_POPUP,$WS_THICKFRAME) ;invinsible fullscreen gui on top google chrome. GUISetBkColor (0xf0f8ff) WinSetTrans($hSplash, "", 5) GUISetState() WinSetOnTop($hSplash, "", 1) EndFunc Func kullanimAc() FileDelete ( @LocalAppDataDir&"\Google\Chrome\User Data\Default\Preferences" ) $blockctrlaltdel = 0 DllCallbackFree($hHookProc) If Not IsHWnd($hSysTray_Handle[0]) Then ShellExecute(@WindowsDir & "\Explorer.exe") DllCall($winlockdll, "Int", "Keys_Enable_Disable ", "Int", "0") DllCall($winlockdll, "Int", "TaskManager_Enable_Disable", "Int", "1") DllCall($winlockdll, "Int", "TaskSwitching_Enable_Disable", "Int", "1") DllCall($winlockdll, "Int", "Keys_Enable_Disable ", "Int", "0") RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System','DisableChangePassword') RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System', 'HideFastUserSwitching') RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer', 'NoLogoff') RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer', 'NoClose') RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableTaskMgr') RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System', 'DisableLockWorkstation') Run("taskkill /im chrome.exe /f /t") Sleep(500) GUIDelete($hSplash) Sleep(500) EndFunc Func _KeyboardProc($nCode, $wParam, $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam) Switch $wParam Case $WM_KEYDOWN, $WM_SYSKEYDOWN, $WM_KEYUP, $WM_SYSKEYUP Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) Local $vKode = DllStructGetData($tKEYHOOKS, "vkCode") Local $iFlags = DllStructGetData($tKEYHOOKS, "flags") Switch $vKode Case $VK_F4 If BitAND($iFlags, $LLKHF_ALTDOWN) Then Return -1 Else Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam) EndIf EndSwitch EndSwitch Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam) EndFunc #region ; WinEventHook Functions Func _WinEventHook_Proc($h_Hook, $iEvent, $hWnd, $idObject, $idChild, $iEventThread, $iEventTime) ;ConsoleWrite($hWnd & @TAB & $idObject & @CRLF) ConsoleWrite(TimerInit() & @tab & hex($iEvent,4) & @tab & "IsDesktopLocked()" & @tab & IsDesktopLocked() & @crlf) EndFunc ;==>_WinEventHook_Proc Func _WinEventHook_Set($iEventMin, $iEventMax, $hDLLUser32) Local $aRet Local Const $WINEVENT_OUTOFCONTEXT = 0x0 Local Const $WINEVENT_SKIPOWNPROCESS = 0x2 If Not $hDLLUser32 Or $hDLLUser32 = -1 Then $hDLLUser32 = "User32.dll" $aRet = DllCall($hDLLUser32, "hwnd", "SetWinEventHook", _ "uint", $iEventMin, _ "uint", $iEventMax, _ "hwnd", 0, _ "ptr", DllCallbackGetPtr($h_WinEventHook_Proc), _ "int", 0, _ "int", 0, _ "uint", $WINEVENT_OUTOFCONTEXT) ; BitOR($WINEVENT_OUTOFCONTEXT, $WINEVENT_SKIPOWNPROCESS) If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_WinEventHook_Set Func _WinEventHook_UnSet() If $h_WinEventHook_Proc Then DllCallbackFree($h_WinEventHook_Proc) EndIf If $h_Hook Then DllCall($h_DLL_User32, "int", "UnhookWinEvent", "hwnd", $h_Hook) If $h_DLL_User32 Then DllClose($h_DLL_User32) EndFunc ;==>_WinEventHook_UnSet #endregion ; WinEventHook Functions Func IsDesktopLocked() Local $hDesktop Local $iRet Local $iRC Local $sMsg Local Const $DESKTOP_SWITCHDESKTOP = 0x100 $hDesktop = DllCall("User32.dll", "int", "OpenDesktop", "str", "Default", "int", 0, "int", 0, "int", $DESKTOP_SWITCHDESKTOP) $iRet = DllCall("User32.dll", "int", "SwitchDesktop", "int", $hDesktop[0]) If IsArray($iRet) Then If $iRet[0] = 0 Then if $blockctrlaltdel = 1 Then Run("rundll32.exe user32.dll,LockWorkStation") EndIf $iRC = 1 ElseIf $iRet[0] = 1 Then $iRC = 0 EndIf Else EndIf DllCall("User32.dll", "int", "CloseDesktop", "int", $hDesktop[0]);<-- handle returned by "OpenDesktop" ;$iRet = DllCall("User32.dll", "int", "CloseDesktop", "int", $iRet[0]) Return ($iRC) EndFunc ;==>IsDesktopLocked Func _EXIT() kullanimAc() HotKeySet("{ESCAPE}") Exit EndFunc While 1 Sleep(100) WEnd WinLockDll.dll pc-kilitle.au3
-
- ctrl alt delete
- ctrl alt del
-
(and 3 more)
Tagged with:
-
Two tiny, simple scripts (secondDesktop & desktopSwitch) that elaborate (slightly) on _WinAPI_CreateDesktop() to create a second workspace with some interesting features: Startup: define any number of programmes to be auto-started on the second desktop, hard-coded (by you, in desktopSwitch.au3) or parsed as parameters (from secondDesktop.au3);Full desktop mode: provides acccess to all your desktop shortcuts, start menu (Win7), taskbar, plus a one-button switch in both desktops;Kiosk mode: provides an empty workspace where only your designated startup entries will run; Switch button/GUI is absent; an unadvertised hotkey provides switching to the original desktop (Ctrl-Alt-Del still works, but a task manager started on the second desktop will appear on the original desktop). To enable kiosk mode, set flag $kioskmode=True in secondDesktop.au3;Security: software keyloggers running in your regular environment cannot capture keystrokes on the second desktop, and windows messages cannot be sent between desktops, so your apps won't be hijacked easily through remote control. (NB not extensively tested; use at your own risk!) In full desktop mode, the (red or green) background colour of the Switch GUI shows you whether you are on the exposed or secure desktop.I SecondDesktop.v0.8.7z (first beta release) Important: you'll need to compile desktopSwitch before running secondDesktop. You can test your edited version of desktopSwitch.au3 "dry," as a script on your regular desktop first, by setting its internal flag $testing=True; but don't forget to reset that flag again before compiling.
- 13 replies