Advertisement
TrunghieuTH10

Hide/Show_Password

Oct 20th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.90 KB | None | 0 0
  1. #RequireAdmin
  2. #include <GUIConstantsEx.au3>
  3. #include <EditConstants.au3>
  4. $hGUI = GUICreate("Test", 200, 120)
  5. $cInput = GUICtrlCreateInput("Password", 32, 8, 145, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD, $ES_AUTOHSCROLL))
  6. $sShow = GUICtrlCreateCheckbox("Show pass", 32, 40, 121, 17)
  7. GUICtrlSetState($sShow, $GUI_FOCUS)
  8. GUISetState()
  9.  
  10. Global $sDefPasswordChar = GUICtrlSendMsg($cInput, $EM_GETPASSWORDCHAR, 0, 0)
  11.  
  12. While 1
  13.     Switch GUIGetMsg()
  14.         Case $GUI_EVENT_CLOSE
  15.             Exit
  16.         Case $sShow
  17.             Switch GUICtrlRead($sShow)
  18.                 Case 1
  19.                     GUICtrlSendMsg($cInput, $EM_SETPASSWORDCHAR, 0, 0)
  20.                 Case 4
  21.                     GUICtrlSendMsg($cInput, $EM_SETPASSWORDCHAR, $sDefPasswordChar, 0)
  22.             EndSwitch
  23.             GUICtrlSetState($cInput, $GUI_FOCUS)
  24.             GUICtrlSetState($sShow, $GUI_FOCUS)
  25.     EndSwitch
  26.  
  27. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement