Any thoughts on what I could try?
Below, please see some test script I've run to try to get a value for this field. I've also tried using Winspector to intercept messages being sent, but there doesn't appear to be any recognizable text coming through from what I can tell.
Code: Select all
MouseGetPos,,,,hwndMouse, 2 ControlGetText, txtMouse,, ahk_id %hwndMouse% WinGet, hwndFocusWindow, ID,, STRUCTURE # ;This gets the HWND of the parent window, which is a control inside the main window. ControlGetFocus, nameFocus, ahk_id %hwndFocusWindow% ;This gets the name (NOT HWND) of the focused control within the STRUCTURE # control. ControlGet, hwndFocus, hwnd,, %nameFocus%, ahk_id %hwndFocusWindow% ;This gets the HWND of the focused control using the control name and the parent control HWND ControlGetText, txtFocus,, ahk_id %hwndFocus% ;This is giving me a value of '6' regardless of what the text displays from the (what appears to be a) dropdown menu. ControlGet, testFocus, List,, ahk_id %hwndFocus% ControlGet, testFocus2, List, Count, ahk_id %hwndFocus% ControlGet, testFocus3, Selected,, ahk_id %hwndFocus% ControlGet, testFocus4, CurrentLine,, ahk_id %hwndFocus% ControlGet, testFocus5, Style,, ahk_id %hwndFocus% MsgBox, % "hwndMouse:" hwndMouse ".`n" "txtMouse:" txtMouse ".`n" "txtFocus:" txtFocus ".`n" "hwndFocusWindow:" hwndFocusWindow ".`n" "nameFocus:" nameFocus ".`n" "hwndFocus:" hwndFocus ".`n" "testFocus:" testFocus ".`n" "testFocus2:" testFocus2 ".`n" "testFocus3:" testFocus3 ".`n" "testFocus4:" testFocus4 ".`n" "testFocus5:" testFocus5 ".`n" ;~ SendMessage, 0x188, 0, 0, ListBox1, WinTitle ; 0x188 is LB_GETCURSEL (for a ListBox). SendMessage, 0x147, 0, 0, %nameFocus%, ahk_id %hwndFocusWindow% ; 0x147 is CB_GETCURSEL (for a DropDownList or ComboBox). ChoicePos = %ErrorLevel% ; It will be -1 if there is no item selected. MsgBox % ChoicePos ;Always yields 1