sacroyant Posted November 16, 2008 Share Posted November 16, 2008 I write a small tools using AutoIT, used to lock the screen when a temporary leave of machinery, named Screen Lock.The operating principle is very simple. In time activate first, Screen Lock asked to create the password and encryption MD5 and save as a key in Regedit. Then, each time the trigger, it will display a window as the cover of the entire screen and you want to disable it must enter a password to close this window. The problem is that if foreigners subject to the "window" on the keyboard, Programs menu and tasks appear!How to solve this problem? Please help me !Thanks in advance ! Link to comment Share on other sites More sharing options...
herewasplato Posted November 16, 2008 Share Posted November 16, 2008 See if this thread helps http://www.autoitscript.com/forum/index.ph...showtopic=81275 [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
sacroyant Posted November 16, 2008 Author Share Posted November 16, 2008 See if this thread helps http://www.autoitscript.com/forum/index.ph...showtopic=81275 herewasplato, thanks. I have seen that topic and other related thread, but still can not find ways to solve problems. The source of the Screen Lock as below, you expect the review to help me expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <md5.au3> Opt("TrayIconHide", 1) Global $title, $screenWidth, $screenHeight, $key, $keyPath, $mainWin $title="Screen Lock" $screenWidth=@DesktopWidth $screenHeight=@DesktopHeight $key="Primary Key" $keyPath="HKEY_LOCAL_MACHINE\SOFTWARE\Screen Lock" $mainWin=GUICreate ($title, $screenWidth, $screenHeight, -1, -1) ;///////////////////////////////////////////////// Func setPassword($pwd) RegDelete($keyPath, $key) RegWrite($keyPath, $key, "REG_SZ", MD5($pwd)) EndFunc Func getPassword() Return RegRead($keyPath, $key) EndFunc Func checkPassword($input) Local $result, $pwd $result=False $pwd=getPassword() If $pwd <> "" And MD5($input) == $pwd Then $result=True EndIf Return $result EndFunc Func lock() GUISetState(@SW_SHOW, $mainWin) GUICtrlCreateLabel ("", 0, 0, $screenWidth, $screenHeight) GUISetBkColor(0xff0000) EndFunc Func unlock() GUISetState(@SW_HIDE, $mainWin) EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func getTop($winHeight) Return Ceiling(($screenHeight-$winHeight)/2) EndFunc Func getLeft($winWidth) Return Ceiling(($screenWidth-$winWidth)/2) EndFunc ;///////////////////////////////////////////////// Dim $keypwd, $pwdMaster, $pwdInput $keypwd=getPassword() If $keypwd=="" Then $pwdMaster=InputBox ( $title, "Create master password : ", "", "*", 240, 60, getLeft(250), getTop(60), 0, $mainWin) If $pwdMaster<>"" Then setPassword($pwdMaster) EndIf Else lock(); While checkPassword($pwdInput)==False $pwdInput=InputBox ( $title, "Do you want to unlock screen now ? ", "", "*", 250, 60, getLeft(250), getTop(60), 0, $mainWin) If checkPassword($pwdInput)==True Then unlock() Exit ElseIf $pwdInput=="" Then MsgBox(0, "Error", "Please enter password to unlock ! ") Else MsgBox(0, "Error", "Password you entered is not valid ! ") EndIf WEnd EndIf ; End ProgramScreenLock.au3md5.au3 Link to comment Share on other sites More sharing options...
herewasplato Posted November 16, 2008 Share Posted November 16, 2008 > The problem is that if foreigners subject to the "window" on the keyboard, Programs menu and tasks appear! Something is lost in the translation to English. Is this what you meant? [Pressing the WinKey or Ctrl-Esc] on the keyboard [makes the] Programs menu and tasks appear! [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
sacroyant Posted November 16, 2008 Author Share Posted November 16, 2008 > The problem is that if foreigners subject to the "window" on the keyboard, Programs menu and tasks appear! Something is lost in the translation to English. Google Translate Is this what you meant? [Pressing the WinKey or Ctrl-Esc] on the keyboard [makes the] Programs menu and tasks appear! I want to say that is when the screen is locking, if somebody press on the "window" key, menu Start and taskbar of Window will appear above ScreenLock. How to set the ScreenLock's window away on top ? Link to comment Share on other sites More sharing options...
herewasplato Posted November 17, 2008 Share Posted November 17, 2008 Then we are back to my first suggestion - disable the WinKey ("window" key). Maybe someone that is more familar with the GUI functions can say if setting the "on top" attribute will keep it top most or in the Windows OS always wins. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now