I was tempted to react because some parts of the code were fishy: the double ahk_pid without space, the test on a specific program.
But after clean up I tested it on a well known application: the HTML help of AutoHotkey, after the search of a keyword:
Code:
Process Exist, HH.exe
If (errorlevel = 0)
ExitApp
Else
{
WRPID := errorlevel
errorlevel = 0
}
; Get the ID
ControlGet searchResultID, Hwnd, , SysListView321, ahk_pid %WRPID%
; The problematic command
ControlGet count, List, Count, , ahk_id %searchResultID%
ControlGet results, List, Count, , ahk_id %searchResultID%
; Verify the ID is correct
ControlGetPos x, y, w, h, , ahk_id %searchResultID%
MsgBox PID: %WRPID%`nID: %searchResultID%`n# %count%`n%x% %y% %w% %h%`n%results%
; Compare with classical Get
ControlGet count, List, Count, SysListView321, AutoHotkey Help
ControlGet results, List, , SysListView321, AutoHotkey Help
MsgBox # %count%`n%results%
Return
Indeed, I have no results with the ID, so either I miss something myself, or something is broken.
It is
documented that "
The syntax for ListView retrieval is:
ControlGet, OutputVar, List, Options, SysListView321, WinTitle, WinText",
so if it is a limitation, I suggest to explicitly state that the ID way doesn't work.
[EDIT] Corrected typos.