Not sure I can do much about this, but would seem to be a bit of a hole in MS's capabilities.
I have an application (Java) which fires up a number of "Main" Windows, ie just off the root level in the OpenWindows treeview from the View System Windows browser (actually SunAWTFrames). All the Windows have the same name.
When they appear (can be one to many ...), I (may) want to Close them. So, I'm doing something like ...
Code: Select all
GetWindowList>winlist
Separate>winlist,CRLF,windows
Let>p=1
Repeat>p
Let>this=windows_%p%
Length>this,iWinNameLength
REM Handle The Windows with No Name!
If>iWinNameLength>0
Position>%strSuppressWinName%,this,1,iFoundWin
If>iFoundWin=1
CloseWindow>this
EndIf
EndIf
Let>p=p+1
Until>p>windows_count
So, when I iterate over the Window List, the "CloseWindow>this" keeps sending a WM_CLOSE to the first Window found (ie the first one that gets hidden), all the others remain visible and open.
What I really want to do is iterate over an array of Window *handles* and close by handle, but I don't think that there is any way to do this (ie "GetWindowList>winlist" can't be set-up to give me an array of handles/name pairs (or synchronised arrays)).
I appreciate the issue described in the Help manual to do with name mathcing, but this is killing me here. Are there any workarounds, or does anybody have any VBScript code that could help me?
Any help greatly appreciated.