Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

child GUI's controls names not visible when using OnMessage

  • Please log in to reply
1 reply to this topic
  • Members
  • 199 posts
  • Last active: Jan 31 2014 03:19 PM
  • Joined: 16 May 2010
here is an example
tooltip somehow show control names from parent gui
OnMessage( 0x200, "Tlp" )
Gui, parentgui:New,,parent
Gui, parentgui:Default
gui,add,edit, vparentcontrol1 w50,1
gui,add,edit, vparentcontrol2 w50,2
Gui, childgui:New, +ParentParentgui -Caption +Border
Gui, childgui:Default
gui,add,edit, vchildcontrol1 w50,3
gui,add,edit, vchildcontrol2 w50,4
gui,show,x70 y10 w100 h100
gui,parentgui:show,w200 h200

tlp(p_w, p_l, p_m, p_hw)
	tooltip % A_GuiControl "`n" A_Gui

i found a solution though, but it looks like bug:
tlp(p_w, p_l, p_m, p_hw)
hGui := DllCall( "GetParent", "Ptr", p_hw )
GuiControlGet, controlName,% hGui ":Name",% p_hw
tooltip % controlName

  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
✓  Best Answer

Fixed in v1.1.09.03.


Note that in this case, A_Gui refers to the child Gui (which contains A_GuiControl), while the Last Found Window is the top-level window which contains the control (i.e. parentgui).