Search the Community
Showing results for tags 'arraywindow'.
Hello guys! I have a little problem in one of my function/functions. Here is my code: Func IsVisible($handle) If BitAND(WinGetState($handle), 4) Then ;If Not BitAND(WinGetState($handle), 16) Then If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndIf EndFunc ;==>IsVisible Func _GetWindows() ; Global $i = 12 ;Local $anumber = 0 / or use &i? Dim $VisibleWindows = [["0", ""]] $AllWindows = WinList() For $i = 1 To $AllWindows If IsVisible($AllWindows[$i]) Then If $AllWindows[$i] <> "" And $AllWindows[$i] <> "Program Manager" Then ReDim $VisibleWindows[UBound($VisibleWindows) + 1] $VisibleWindows = $VisibleWindows + 1 $VisibleWindows[($VisibleWindows)] = $AllWindows[$i] $VisibleWindows[($VisibleWindows)] = $AllWindows[$i] EndIf Else EndIf Next _ArrayDisplay($VisibleWindows, "Visible Windows") ;If WinClose("Visible Windows", "") = 1 Then Idle() EndFunc ;==>_GetWindows This should display all windows and their respective handels that WinList function can find, and display it in a "Visible Windows" titled arraydisplay. All good there, script runs as expected. I copied the code for the _GetWindows() from here, and implemented it with minimal changes as I recall (sorry I found it more then a month ago). My problem is that If I try to close the "Visible Windows" Window, the script just reopens anotherone, basicly the only thing I can do is terminate the script somehow after I started to display this. I'm pretty sure that there is something small that I miss, but since I can't really bend my mind around the _GetWindows array creation, I can't really pinpoint why it opens it again when I close it. (I try to used WinClose but thats just stupid since there is noproblem with closing, the problem is the reopening, realized that while I was writing it) Thank you for your help!