Hi Skan,
Skan wrote:
Code:
~+MButton::
MouseGetPos,,,,cHwnd, 2
Control, ExStyle, +0x20, ,ahk_id %cHwnd%
SendMessage, 0xCC, Asc("*"), 0,, ahk_id %cHwnd%
; The following redraws the Control
Control, Hide,,,ahk_id %cHwnd%
Control, Show,,,ahk_id %cHwnd%
Return
Thanks for this vey interesting code.
BTW, ES_PASSWORD is Style, not ExStyle, of the (single-line) edit control.
So, I suppose the ExStyle, +0x20 (:WS_EX_TRANSPARENT) does no effect on the password style.
SendMessage with EM_SETPASSWORDCHAR seems to be the essential one.
Just for fun, please try to type C:\ after executing the following script:
Code:
Gui, Add, Edit, w640 HWNDhMyEdit
SendMessage, 0xCC, Asc("*"), 0,, ahk_id %hMyEdit% ; Add ES_PASSWORD Style
SHAutoComplete(hMyEdit)
Gui, Show
;Sleep, 10000
;SendMessage, 0xCC, 0, 0,, ahk_id %hMyEdit% ; Remove ES_PASSWORD Style
Return
~Enter::
ControlGetText, MyText, , ahk_id %hMyEdit%
Run, %MyText%
GuiClose:
ExitApp
SHAutoComplete(hEdit)
{
DllCall("ole32\CoInitialize", "Uint", 0)
DllCall("shlwapi\SHAutoComplete", "Uint", hEdit, "Uint", 0)
DllCall("ole32\CoUninitialize")
}