Code: Select all
Gui, 1:New, , Main Window
Gui, Font, s10 w500, Tahoma
Gui, Add, Button, gWin2, Open Second Window
Gui, Add, Button, gEnd, Quit
Gui, 2:New, , Second Window
Gui, 2:+Owner
Gui, Font, s10 w500, Tahoma
Gui, Add, Text, w240 r3 , The edit box's ID is 'TagEntry'. The Down key should put keyboard focus in the ListBox which has ID 'TagChoice'.
Gui, Add, Text, xm y+12, Add tag
Gui, Add, Edit, vTagEntry w148 x+10 yp-4 gTagEntryChanged, Hit Down here
Gui, Add, ListBox, r15 vTagChoice w200 x12, This is the|target for|when I use the|down key in|the editbox.
Gui, 1:Default
Gui, 1:Show, w270 h100
return
Win2:
Gui, 2:Show
return
TagEntryChanged:
; irrelevant
return
End:
ExitApp
return
#IfWinActive, Second Window, Add tag
~Down::
GuiControlGet, where, 2:FocusV
if (where != "TagEntry")
return
GuiControl, Focus, 2:TagChoice
GuiControlGet, now_where, 2:FocusV
MsgBox % "Focused control is " . now_where
return
#IfWinActive