The help text for the _ArrayDisplay function says: "Clicking on a column header sort it."
I'm wondering why the sorting of hex numbers (specifically window handles like 0x12345678) is so wonky.
#include <Array.au3> Local $aList = WinList() _ArrayDisplay($aList) Clicking on the Col1 header to sort by window handle doesn't properly sort the list.
As a workaround, I'm sorting the array by window handle before displaying it using _ArraySort. But I still wonder what's up with the ListView sorting.
#include <Array.au3> Local $aList = WinList() _ArraySort($aList, 0, 1, 0, 1) _ArrayDisplay($aList)
I have a small script that checks if users from certain security groups exist or are disabled in AD.
For $j = Ubound ( $Users, 1 ) -1 To 0 Step -1 Switch _AD_IsObjectDisabled ( $Users[$j] ) Case 1 ClipPut ( $Users[$j] & " - account disabled; " ) Case 0 If @error = 1 Then ClipPut ( $Users[$j] & " - account not found; " ) Else ClipPut ( $Users[$j] & " - Ok; " ) EndIf EndSwitch $Clip = $Clip & @CRLF & ClipGet () Next $Data[$O] = $Clip The code works correctly, at the end I have a 2D array $Data with security group in column 1 and checked user accounts in columns 2. However, _ArrayDisplay ( $Data ) shows users in one row, despite I added @CRLF. When I write $Clip to a text file, user accounts are written as column. Isn't it possible to have multiple-line cell split by @CRLF in _ArrayDisplay?
_ArrayDisplay($aArray, "Window Title", "1:", 0, Default, "Column") ; Expected results are rows 1 to the end of the array, all columns. The result is rows 0-1, all columns. The API reference is here:
Am I doing something wrong?
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!
I am running the production version of AutoIt 188.8.131.52 on Windows 7 Enterprise 64bit.
I have found that _ArrayDisplay will go blank after several seconds. See the attached screen caps. The delay period is arbitrary. This occurs both in interpretive execution and in a compiled exe. This does not occur when I run the same code on a Windows XP SP3 machine with 184.108.40.206. The condition is consistent (for me) running the following code.
#include <Array.au3> Dim $array = ['Running Windows 7 Enterprise 64bit', 'Just wait 5 to 30 seconds or so.', _ 'This ArrayDisplay will go blank (grey).', 'Clicking in the display will refresh', _ 'individual lines.', 'See the screencaps.'] _ArrayDisplay($array)