#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=..\..\ICONS\KEY&LOCK.ico #AutoIt3Wrapper_Res_Description=Makes a secure folder #AutoIt3Wrapper_Res_Fileversion=0.0031 #AutoIt3Wrapper_Res_LegalCopyright=Bob #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: Bob Script Function: Keeps A Secure Folder #ce ---------------------------------------------------------------------------- #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <Misc.au3> #Include <GuiEdit.au3> #include <StaticConstants.au3> #Include <String.au3> #include <SendMessage.au3> HotKeySet ('^{F1}', 'ChangePass') Opt ('GuiOnEventMode', 1) Opt ('MustDeclareVars', 1) Global $Lockerpath = 'C:\LOCKER\' Global $Lsoectkteirngs_ini = @ScriptDir & '\LSOECTKTEIRNGS.ini' If Not FileExists ($Lockerpath) & Not FileExists ($Lsoectkteirngs_ini) Then DirCreate ($Lockerpath) IniWrite ($Lsoectkteirngs_ini, '********', '********', _StringToHex ('tbhoeb')) EndIf Dim $CurrentPassword = _HexToString (IniRead ($Lsoectkteirngs_ini, '********', '********', '')) Global $GUI = GUICreate ('LOCKER', 400, 145, -1, -1, -2139094904) GUISetBkColor (0x0, $GUI) GUISetFont (30, '', '', 'Courier New', $GUI) Global $L = GUICtrlCreateLabel ('', 0, 0, 400, 20) GUICtrlSetBkColor ($L, 0xFFFFFF) Global $STATUSLABEL = GUICtrlCreateLabel ('LOCKER', 10, 30, 260, 50) Dim $STATUSICON = GUICtrlCreateButton ('', 270,30, 100, 100, $BS_ICON) Global $PASSWORD = GUICtrlCreateInput ('', 10, 70, 240, 50, $ES_PASSWORD) GUICtrlSetBkColor ($PASSWORD, 0x0) GUICtrlSetColor ($PASSWORD, 0xFFFFFF) If FileGetAttrib ($Lockerpath) = 'RSHD' Then GUICtrlSetImage ($STATUSICON,'Shell32.dll', -48) Dim $LockStatus = 0 Else GUICtrlSetImage ($STATUSICON,'Shell32.dll', -45) Dim $LockStatus = 1 EndIf GUICtrlSetColor ($STATUSLABEL, 0xFFFFFF) GUICtrlSetOnEvent ($STATUSICON, 'Setattrib') GUICtrlSetOnEvent ($L, '_WinMove') GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit') GUISetState () While 1 Sleep (100) WEnd Func ChangePass () If $LockStatus = 1 Then Local $i = InputBox ('Change Password...', 'Choose a new Password', 'Password', '*', 400, 120, -1, -1, '', $GUI) IniWrite ($Lsoectkteirngs_ini, '********', '********', _StringToHex ($i)) $CurrentPassword = $i EndIf EndFunc Func Setattrib () If GUICtrlRead ($PASSWORD) = $CurrentPassword Then If $LockStatus = 0 Then $LockStatus = 1 GUICtrlSetImage ($STATUSICON, 'Shell32.dll', -45) FileSetAttrib ($Lockerpath, '-SH') GUICtrlSetData ($PASSWORD, '') ShellExecute (@WindowsDir & '\explorer.exe', $Lockerpath) ElseIf $LockStatus = 1 Then $LockStatus = 0 GUICtrlSetImage ($STATUSICON, 'Shell32.dll', -48) FileSetAttrib ($Lockerpath, '+SH') GUICtrlSetData ($PASSWORD, '') EndIf EndIf EndFunc Func _WinMove () While _IsPressed ('01') Local $x = MouseGetPos (0) Local $y = MouseGetPos (1) WinMove ($GUI, '', $x, $y) WEnd EndFunc Func _Exit () FileSetAttrib ($Lockerpath, '+SH') Exit EndFunc
EDIT
*Added
-INIREAD password change & _Stringtohex () convertion before writeing to ini
EDIT
*Added
-Gui set pos accoording to mousepos... click secondary on the background.. then primary to cancel it
EDIT
*Added
-GUI custom title bar
EDIT
*changed ShellExecute ('explorer.exe', $Lockerpath) TO ShellExecute (@WindowsDir & '\explorer.exe', $Lockerpath)
Edited by CodyBarrett, 05 April 2009 - 07:21 PM.





