Advertisement
TrunghieuTH10

NTT

Nov 9th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.59 KB | None | 0 0
  1. #include <ButtonConstants.au3>
  2. #include <EditConstants.au3>
  3. #include <GUIConstantsEx.au3>
  4. #include <StaticConstants.au3>
  5. #include <WindowsConstants.au3>
  6. #Region ### START Koda GUI section ### Form=
  7. $Form = GUICreate("Login Form", 286, 130, 191, 124)
  8. GUISetBkColor(0xC0DCC0)
  9. GUICtrlCreateLabel("Please input the password", 16, 8, 231, 25)
  10. GUICtrlSetFont(-1, 8, 400, 0, "Segoe Script")
  11. $Input1 = GUICtrlCreateInput("ddssd",16,40,169,21,BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
  12. GUICtrlSetColor(-1, 0x00BFFF)
  13. $ck = GUICtrlCreateCheckbox("Show", 200, 40, 65, 25)
  14. GUICtrlSetState($ck, $GUI_FOCUS)
  15. $Button1 = GUICtrlCreateButton("Login", 16, 80, 73, 33)
  16. GUICtrlSetFont(-1, 8, 400, 0, "Segoe Script")
  17. $Button2 = GUICtrlCreateButton("Exit", 112, 80, 73, 33)
  18. GUICtrlSetFont(-1, 8, 400, 0, "Segoe Script")
  19. GUISetState(@SW_SHOW)
  20. #EndRegion ### END Koda GUI section ###
  21. $DefaultPassChar= GUICtrlSendMsg($Input1,$EM_GETPASSWORDCHAR,0,0)
  22. While 1
  23.     $nMsg = GUIGetMsg()
  24.     Switch $nMsg
  25.         Case $Button2, -3
  26.             Exit
  27.         Case $Button1
  28.             dangnhap($Input1, 1810)
  29.         Case $ck
  30.             Switch GUICtrlRead($ck)
  31.                 Case 1
  32.                     GUICtrlSendMsg($Input1, $EM_SETPASSWORDCHAR, 0, 0)
  33.                 Case 4
  34.                     GUICtrlSendMsg($Input1, $EM_SETPASSWORDCHAR, $DefaultPassChar, 0)
  35.             EndSwitch
  36.          GUICtrlSetState($Input1, $GUI_FOCUS)
  37.          GUICtrlSetState($ck, $GUI_FOCUS)
  38.  
  39.     EndSwitch
  40. WEnd
  41.  
  42.  
  43. Func dangnhap($Input,$pass)
  44.    $Inputpass=GUICtrlRead($Input)
  45.    If $Inputpass = $pass Then
  46.       MsgBox(0,"","Hello")
  47.    Else
  48.       MsgBox(0,"", "Please check the password")
  49.    EndIf
  50.  
  51. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement