If notepad is complicating the issue, here is an example with AHK.
Using
GuiControl works as expected:
Code: Select all
M := 10
Gui, Margin, %M%, %M%
Gui, Font, s16
Gui, Add, Edit, Password vEdit1 w200, Hello world
Gui, Add, Checkbox, -Checked vCheckbox1 gShow wp, Show password
Gui, Show
ControlGet, ControlHwnd, Hwnd, , Edit1, ahk_class AutoHotkeyGUI
;MsgBox % ControlHwnd
Return
Show()
{
Global
Gui, Submit, NoHide
If Checkbox1
{
GuiControl, -Password, Edit1
;Control, Style, -0x20, , ahk_id %ControlHwnd%
}
Else
{
GuiControl, +Password, Edit1
;Control, Style, +0x20, , ahk_id %ControlHwnd%
}
}
but
Control does not:
Code: Select all
M := 10
Gui, Margin, %M%, %M%
Gui, Font, s16
Gui, Add, Edit, Password vEdit1 w200, Hello world
Gui, Add, Checkbox, -Checked vCheckbox1 gShow wp, Show password
Gui, Show
ControlGet, ControlHwnd, Hwnd, , Edit1, ahk_class AutoHotkeyGUI
;MsgBox % ControlHwnd
Return
Show()
{
Global
Gui, Submit, NoHide
If Checkbox1
{
;GuiControl, -Password, Edit1
Control, Style, -0x20, , ahk_id %ControlHwnd%
}
Else
{
;GuiControl, +Password, Edit1
Control, Style, +0x20, , ahk_id %ControlHwnd%
}
}
What am I missing here?