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)
_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!
Hi, Please look at the code below:
#include <File.au3> #include <Array.au3> ; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ; #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> #include <GuiListView.au3> Global $hGUI = GUICreate("GUIx",283,120,-1,-1,-1,-1) GUISetBkColor(0xFFFFFF,$hGUI) $hListX = GUICtrlCreatelistview("ColumnX|ColumnY|ColumnZ",4,4,269,65,4,544) ; GUICtrlCreatelistview("ListX",7,4,269,65,-1,512) GUICtrlSetData(-1, "ColumnX|ColumnY|ColumnZ") $hButtonY = GUICtrlCreateButton("ButtonY",20,80,100,30,-1,-1) $hButtonZ = GUICtrlCreateButton("ButtonZ",160,80,100,30,-1,-1) GUISetState() While True $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $hButtonY AddRows() EndSwitch WEnd Func AddRows() Local $aFiles = _FileListToArray(@ScriptFullPath & '\FolderX', Default, Default, True) _ArrayDisplay($aFiles) Local $aContent For $i = 0 To UBound($aFiles) - 1 MsgBox(0, "", $aFiles) $aContent = FileReadToArray($aFiles[$i]) Next For $i = 0 To UBound($aContent) - 1 Step 3 GUICtrlCreateListViewItem($aContent[$i] & '|' & $aContent[$i + 1] & '|' & $aContent[$i + 2], $hListX) Next EndFunc _ArrayDisplay at line no. 33 is not working, I don't know what is happening...
Thanks in Advance, TD
P.S Actually the code was for another question but while debugging the code, I encountered this problem
I am running the production version of AutoIt 18.104.22.168 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 22.214.171.124. 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)