How to write to this gui text control
Posted: 21 Sep 2021, 03:21
Using Static1 is not an option so I am trying to use the hwnd of the control, I tried even the most ridiculous combinations
Code: Select all
#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
Gui Add, Text, x79 y13 w275 h23 +0x200 hwndF1,
Gui Add, Button, x177 y83 w80 h23 gworks, Works
Gui Add, Button, x177 y110 w80 h23 gnowork, Doesn't work
Gui Show, w453 h212, Window
Return
works:
ControlSetText,,Hello, ahk_id %F1%
return
nowork:
loop, 1
{
field = F%a_index%
field2 := "F" a_index
MsgBox, % field "`n" field2
ControlSetText,,NoWork, ahk_id F%a_index%
ControlSetText,,NoWork, ahk_id F %a_index%
ControlSetText,,NoWork, ahk_id "F" %a_index%
ControlSetText,,NoWork, ahk_id "F" a_index
ControlSetText,,NoWork, ahk_id %field%
ControlSetText,,NoWork, ahk_id %field2%
ControlSetText,,NoWork, ahk_id %F%%a_index%
ControlSetText,,NoWork, ahk_id %Fa_index%
}
return
GuiEscape:
GuiClose:
ExitApp