Code: Select all
Gui,1:Add,Text,X100 Y100 vGuiTextDebug HwndstringHwndTextDebug,Debug text goes here
This gave me a lot of difficulty until I used the 'round the houses' method of getting the classNN of the control and using that to retrieve the Hwnd.
I've never had AHK fail to store the hwnd for a control before so I'm wondering if anyone knows what might be causing this?
Here is the long winded method functions in case anyone needs them:
Code: Select all
;temporarily passes focus to controls so may cause issues if they have actions assigned to them
getClassNN(controlname,window="A")
{
;store the focused control before changing
ControlGetFocus,CONTROL_FOCUSED,%window%
;switch focus to passed control
GuiControl,Focus,%controlname%
;get classNN of whatever the focused control is in the window
ControlGetFocus,Class_NN,%window%
;return focus to the previous control
GuiControl,Focus,%CONTROL_FOCUSED%
return Class_NN
}
Code: Select all
stringClassNN := getClassNN("GuiTextDebug")
ControlGet, stringHwndTextDebug, Hwnd,, %stringClassNN%,A