
Returns a list of all open windows and their Window ID's.
WinItemNameId( )
(none)
(s) list of the titles and Window ID's of all open windows.
This function returns a list of top-level window titles and their corresponding "Window ID's", in the form:
"window1-name|window1-ID|window2-name|window2-ID|..."
Window ID's
The window ID is a specially formatted string that represents a 'pseudo-handle' of the window, that only WinBatch recognizes.
Windows ID's are recognized by all functions that also accept a partial window name.
You can use cWinIdConvert ( Control manager Extender) to convert between a true Windows handle and a Window Id (pseudo-handle). If you pass in a Windows handle, the function returns the corresponding Window ID. Conversely, if you pass in a Window ID, the function returns the corresponding Window handle.
#DefineFunction UDFReformat_List (list)
newlist = ""
count = ItemCount( list,"|")
count = count/2
For x = 1 To count By 2
title= ItemExtract(x,list,"|")
id= ItemExtract(x+1,list,"|")
newlist = StrCat(newlist,Title,"|",id,@TAB)
Next
newlist = StrTrim(newlist)
Return newlist
#EndFunction
winlist = WinItemNameId( )
list = UDFReformat_List (winlist)
AskItemlist("Windows and ID's", list, @TAB, @UNSORTED,@SINGLE, @FALSE)