Xenobiologist Posted April 20, 2006 Share Posted April 20, 2006 Hi, how can I change it? Example code: #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 622, 441, 192, 125) $Input1 = GUICtrlCreateInput("AInput1", 48, 32, 121, 21, -1, $WS_EX_CLIENTEDGE) $Input2 = GUICtrlCreateInput("AInput2", 48, 64, 121, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("AButton1", 240, 32, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $Button1 GUICtrlSetStyle($Input1, $ES_PASSWORD ,$WS_EX_CLIENTEDGE) Case Else ;;;;;;; EndSelect WEnd Exit Thanks! Can be easy, but I don't get it right now. :"> So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 20, 2006 Moderators Share Posted April 20, 2006 (edited) This is as close as I can come , maybe Gary could shed more lite, If I'm not mistaken I got the idea from him in a post many moons ago.#include <GUIConstants.au3> $Form1 = GUICreate("AForm1", 622, 441, 192, 125) $Input1 = GUICtrlCreateInput("AInput1", 48, 32, 121, 21, -1, $WS_EX_CLIENTEDGE) $Input2 = GUICtrlCreateInput("AInput2", 48, 64, 121, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("Convert", 240, 32, 75, 25) $Button2 = GUICtrlCreateButton('Reset, 240, 62, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $Button1 _SetPasswordStyle($Form1, $Input1, '=') Case $msg = $Button2 _SetPasswordStyle($Form1, $Input1, '', 'Ms Sans Serif') Case Else ;;;;;;; EndSelect WEnd Func _SetPasswordStyle($hwnd_GUI, $hwnd_ControlID, $sEncode = '', $v_Font = 'Webdings', $i_FontSize = 9) Local $EM_SETPASSWORDCHAR = 0xCC If $sEncode = '' Then GUICtrlSendMsg($hwnd_ControlID, $EM_SETPASSWORDCHAR, 0, 0) ControlFocus($hwnd_GUI, '', $hwnd_ControlID) GUICtrlSetFont($hwnd_ControlID, $i_FontSize, '', '', $v_Font) Else GUICtrlSendMsg($hwnd_ControlID, $EM_SETPASSWORDCHAR, Asc($sEncode), 0) ControlFocus($hwnd_GUI, '', $hwnd_ControlID) GUICtrlSetFont($hwnd_ControlID, 6, '', '', $v_Font) EndIf EndFunc Edit: I had a word that I had no idea what it meant as a button label Edited April 21, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted April 20, 2006 Share Posted April 20, 2006 #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 622, 441, 192, 125) $Input1 = GUICtrlCreateInput("AInput1", 48, 32, 121, 21, -1, $WS_EX_CLIENTEDGE) $Input2 = GUICtrlCreateInput("AInput2", 48, 64, 121, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("AButton1", 240, 32, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $Button1 _GuiCtrlEditChangePasswordChar($Input1) Case Else ;;;;;;; EndSelect WEnd Exit Func _GuiCtrlEditChangePasswordChar(ByRef $h_edit, $s_newchar = '*') Local const $EM_SETPASSWORDCHAR = 0xCC GUISetState(@SW_LOCK) GUICtrlSetStyle($h_edit, $ES_PASSWORD ,$WS_EX_CLIENTEDGE) GUICtrlSendMsg($h_edit, $EM_SETPASSWORDCHAR, Asc($s_newchar), 0) GUISetState(@SW_UNLOCK) EndFunc SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 20, 2006 Moderators Share Posted April 20, 2006 Speak of the devil Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted April 20, 2006 Share Posted April 20, 2006 Speak of the devil SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 20, 2006 Author Share Posted April 20, 2006 (edited) Hi, thank you very much! Works great. Is there any way to get the ANSI chr(149) back into the func? I only found asc and chr as funcs and they won't work, I suppose. I'll search a bit, but maybe someone is quicker. So long, Mega Edited April 21, 2006 by th.meger Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 20, 2006 Moderators Share Posted April 20, 2006 (edited) Hi,thank you very much! Works great. Is there any way to get the ANSI chr(149) back into the func?I only found asc and chr as funcs and the won't work, I suppose.I'll search a bit, but maybe someone is quicker. So long,MegaWhich one are you talking about?Edit:And what do you mean "back in the function"? Edited April 20, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted April 21, 2006 Share Posted April 21, 2006 Func _GuiCtrlEditChangePasswordChar(ByRef $h_edit, $s_newchar = '*') Local const $EM_SETPASSWORDCHAR = 0xCC GUISetState(@SW_LOCK) If StringInStr(@OSVersion,"WIN_XP") And @NumParams = 1 Then Local $s_text = GUICtrlRead($h_edit) Local $pos = ControlGetPos(WinGetTitle(""),"",$h_edit) GUICtrlDelete($h_edit) $h_edit = GUICtrlCreateInput($s_text, $pos[0], $pos[1], $pos[2], $pos[3], $ES_PASSWORD, $WS_EX_CLIENTEDGE) Else GUICtrlSetStyle($h_edit, $ES_PASSWORD ,$WS_EX_CLIENTEDGE) GUICtrlSendMsg($h_edit, $EM_SETPASSWORDCHAR, Asc($s_newchar), 0) EndIf GUISetState(@SW_UNLOCK) EndFunc SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 21, 2006 Author Share Posted April 21, 2006 Which one are you talking about?Edit:And what do you mean "back in the function"?Hi,yeah you both are really cool and always heplful guys!!! Thanks!I meant when creating an InputBox with $ES_PASSWORD, then the things you type are masked with another sign. I thought it is 149. Your both funcs change the password mask sign in something else. It is not basic, but maybe it is possible to get the original sign back.Clear? It is 3 o'clock in the morning, so my English could be better, I know. :"> So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
GaryFrost Posted April 21, 2006 Share Posted April 21, 2006 My above post should do what you want, the char your looking for is the default password char when the ES_PASSWORD style is used to create the control, and the comctrl is version 6 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 21, 2006 Author Share Posted April 21, 2006 My above post should do what you want, the char your looking for is the default password char when the ES_PASSWORD style is used to create the control, and the comctrl is version 6Hi,works fine. Does the char password char differ on Windows versions (2000, 98)?I think so, because you check for WIN_XP.Nevertheless, thank you!After having a closer look, I even understood what your func does. Simple, but ingenious.So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
GaryFrost Posted April 21, 2006 Share Posted April 21, 2006 Hi,works fine. Does the char password char differ on Windows versions (2000, 98)?I think so, because you check for WIN_XP.Nevertheless, thank you!After having a closer look, I even understood what your func does. Simple, but ingenious.So long,MegaWin XP the default password char is black circles (ComCtl32.dll version 6) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Xenobiologist Posted March 23, 2007 Author Share Posted March 23, 2007 Hi, is there in the meantime an easier way, to set the char or to disable the Password style? So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Info Posted March 24, 2008 Share Posted March 24, 2008 (edited) Sorry for the bumping, I just have a question... How can I disable the '_GuiCtrlEditChangePasswordChar'? I tried expandcollapse popup#include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 622, 441, 192, 125) $Input1 = GUICtrlCreateInput("AInput1", 48, 32, 121, 21, -1, $WS_EX_CLIENTEDGE) $Input2 = GUICtrlCreateInput("AInput2", 48, 64, 121, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("AButton1", 240, 32, 75, 25) $Button2 = GUICtrlCreateButton("AButton2", 240, 64, 75, 25); <<<<<<<<<<<<< new button GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $Button1 $ChangePass = _GuiCtrlEditChangePasswordChar($Input1) Case $msg = $Button2 $ChangePass =0; <<<<<<<<<<<<<<< didn't work... =( Case Else ;;;;;;; EndSelect WEnd Exit Func _GuiCtrlEditChangePasswordChar(ByRef $h_edit, $s_newchar = '*') Local const $EM_SETPASSWORDCHAR = 0xCC GUISetState(@SW_LOCK) If StringInStr(@OSVersion,"WIN_XP") And @NumParams = 1 Then Local $s_text = GUICtrlRead($h_edit) Local $pos = ControlGetPos(WinGetTitle(""),"",$h_edit) GUICtrlDelete($h_edit) $h_edit = GUICtrlCreateInput($s_text, $pos[0], $pos[1], $pos[2], $pos[3], $ES_PASSWORD, $WS_EX_CLIENTEDGE) Else GUICtrlSetStyle($h_edit, $ES_PASSWORD ,$WS_EX_CLIENTEDGE) GUICtrlSendMsg($h_edit, $EM_SETPASSWORDCHAR, Asc($s_newchar), 0) EndIf GUISetState(@SW_UNLOCK) EndFunc And it didn't work... Thanks Edited August 2, 2009 by Info Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 24, 2008 Moderators Share Posted March 24, 2008 Case $msg = $Button2 $ChangePass = _GuiCtrlEditChangePasswordChar($Input1, "") Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
babai93 Posted August 23, 2017 Share Posted August 23, 2017 (edited) expandcollapse popup#include <GUIConstants.au3> #include <FontConstants.au3> $Form1 = GUICreate("AForm1", 300, 100, 192, 125) $Input1 = GUICtrlCreateInput("AInput1", 48, 32, 121, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE) ;$Input2 = GUICtrlCreateInput("AInput2", 48, 64, 121, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("N", 170, 31, 25, 23) ;;Webdings ;GUICtrlSetFont(-1, 12, $FW_NORMAL, $GUI_FONTUNDER, "Webdings") GUICtrlSetFont(-1, 12, -1, -1, "Webdings", 5) $Button2 = GUICtrlCreateButton("N", 170, 31, 25, 23) GUICtrlSetFont(-1, 12, -1, $GUI_FONTSTRIKE , "Webdings") GUICtrlSetState($Button2, $gui_hide) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $Button1 _SetPasswordStyle($Form1, $Input1, '=') GUICtrlSetState($Button1, $gui_hide) GUICtrlSetState($Button2, $gui_show) Case $msg = $Button2 _SetPasswordStyle($Form1, $Input1, '', 'Ms Sans Serif') GUICtrlSetState($Button2, $gui_hide) GUICtrlSetState($Button1, $gui_show) Case Else ;;;;;;; EndSelect WEnd Func _SetPasswordStyle($hwnd_GUI, $hwnd_ControlID, $sEncode = '', $v_Font = 'Webdings', $i_FontSize = 9) Local $EM_SETPASSWORDCHAR = 0xCC If $sEncode = '' Then GUICtrlSendMsg($hwnd_ControlID, $EM_SETPASSWORDCHAR, 0, 0) ControlFocus($hwnd_GUI, '', $hwnd_ControlID) GUICtrlSetFont($hwnd_ControlID, $i_FontSize, '', '', $v_Font) Else GUICtrlSendMsg($hwnd_ControlID, $EM_SETPASSWORDCHAR, Asc($sEncode), 0) ControlFocus($hwnd_GUI, '', $hwnd_ControlID) GUICtrlSetFont($hwnd_ControlID, 6, '', '', $v_Font) EndIf EndFunc try this.... Edited August 23, 2017 by Melba23 Giant quote removed Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 23, 2017 Moderators Share Posted August 23, 2017 babai93, Welcome to the AutoIt forums. But did you realise that the post you quote dates from over 11 years ago? In future please do not resurrect threads from this far back - the language has changed so much that it is likely that the functionality has already been incorporated and the previously posted code will almost certainly not run in the current version of AutoIt without modification. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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