help me in Lock

05/02/2012 16:02 osamaman2008#1
how i Lock my Script with Password ?

Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("tees", 400, 229, 299, 218)
$PasswordEdit = GUICtrlCreateInput("", 96, 24, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$ButtonOk = GUICtrlCreateButton("&OK", 166, 56, 75, 25, $BS_NOTIFY)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 24, 112, 97, 17, $BS_AUTO3STATE)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 168, 112, 97, 17, $BS_AUTO3STATE)
$Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 296, 112, 97, 17, $BS_AUTO3STATE)
$Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 24, 144, 97, 17, $BS_AUTO3STATE)
$Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 168, 152, 97, 17, $BS_AUTO3STATE)
$Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 296, 152, 97, 17, $BS_AUTO3STATE)
$Checkbox7 = GUICtrlCreateCheckbox("Checkbox7", 24, 184, 97, 17, $BS_AUTO3STATE)
$Checkbox8 = GUICtrlCreateCheckbox("Checkbox8", 168, 184, 97, 17, $BS_AUTO3STATE)
$Checkbox9 = GUICtrlCreateCheckbox("Checkbox9", 296, 184, 97, 17, $BS_AUTO3STATE)
$EnterPassLabel = GUICtrlCreateLabel("Enter password", 0, 28, 77, 17, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd
i went Lock Checkbox9 when write password Open lock unlock can help?
05/02/2012 16:12 Achat#2
Sry but I don't know what you mean exactly.

Maybe something like that?:

Code:
$sPW = InputBox('PW','Enter PW','','*')
If Not $sPW == 'YOUR PASSWORD' Then
exit
Endif
Best Regards


EDIT:
btw read some tutorials or you'll fail ;)
05/02/2012 16:20 osamaman2008#3
Quote:
Originally Posted by Achat View Post
Sry but I don't know what you mean exactly.

Maybe something like that?:

Code:
$sPW = InputBox('PW','Enter PW','','*')
If Not $sPW == 'YOUR PASSWORD' Then
exit
Endif
Best Regards


EDIT:
btw read some tutorials or you'll fail ;)
when add not work too and Checkbox dont lock

Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("tees", 400, 229, 299, 218)
$PasswordEdit = GUICtrlCreateInput("", 96, 24, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$ButtonOk = GUICtrlCreateButton("&OK", 166, 56, 75, 25, $BS_NOTIFY)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 24, 112, 97, 17, $BS_AUTO3STATE)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 168, 112, 97, 17, $BS_AUTO3STATE)
$Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 296, 112, 97, 17, $BS_AUTO3STATE)
$Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 24, 144, 97, 17, $BS_AUTO3STATE)
$Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 168, 152, 97, 17, $BS_AUTO3STATE)
$Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 296, 152, 97, 17, $BS_AUTO3STATE)
$Checkbox7 = GUICtrlCreateCheckbox("Checkbox7", 24, 184, 97, 17, $BS_AUTO3STATE)
$Checkbox8 = GUICtrlCreateCheckbox("Checkbox8", 168, 184, 97, 17, $BS_AUTO3STATE)
$Checkbox9 = GUICtrlCreateCheckbox("Checkbox9", 296, 184, 97, 17, $BS_AUTO3STATE)
$EnterPassLabel = GUICtrlCreateLabel("Enter password", 0, 28, 77, 17, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd
$sPW = InputBox('PW','Enter PW','','*')
If Not $sPW == 'test' Then
exit
Endif
05/02/2012 16:44 Achat#4
Quote:
Originally Posted by Achat View Post
btw read some tutorials or you'll fail ;)
What did I just say? :rolleyes:

This can't work because the password prompt comes after the while-loop and after the GUI.
But your script (in that case) will never go out of the while-loop.

Simply place it on top of your Script.

Best Regards
Read some tutorials, it'll help!
05/02/2012 20:41 K1ramoX#5
Dont do it with this way. Hash your Password with MD5 and generate a new hash from the password that was entered, then compare the 2 hashes ;O
05/02/2012 20:57 Achat#6
[Only registered and activated users can see links. Click Here To Register...]

That's unsave, too :p
You could decompile the *.exe and delete the password prompt ^^

Regards