﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3791	Sort arrow not showing in _ArrayDisplay()	pixelsearch		"Bug described in this link :
https://www.autoitscript.com/forum/topic/204379-sort-arrow-in-_arraydisplay/

==========================
Test reproducing the issue :
    #include <Array.au3>
    Global $aSortTest[2][3] = [[""1a"", ""1b"", ""1c""], [""2a"", ""2b"", ""2c""]]
    _ArrayDisplay($aSortTest)

Clicking on a column header doesn't show the sort arrow for either ascending or descending order.

==========================
Cause :
Line 563 in ArrayDisplayInternals.au3 (version 3.3.14.5) sends a wrong message, because it uses a handle instead of a control id
     Local $hHeader = HWnd(GUICtrlSendMsg($hWnd, 0x101F, 0, 0))

==========================
How to fix this (lines 558 to 563)

/ Actual wrong code :

Func __ArrayDisplay_RegisterSortCallBack($hWnd, $vCompareType = 2, $bArrows = True, $sSort_Callback = ""__ArrayDisplay_SortCallBack"")
	  #Au3Stripper_Ignore_Funcs=$sSort_Callback
	If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)

;~ 	Local Const $LVM_GETHEADER = (0x1000 + 31) ; 0x101F
	Local $hHeader =  HWnd(GUICtrlSendMsg($hWnd, 0x101F, 0, 0))

/ Suggested correct code :

Func __ArrayDisplay_RegisterSortCallBack($ControlID, $vCompareType = 2, $bArrows = True, $sSort_Callback = ""__ArrayDisplay_SortCallBack"")
      #Au3Stripper_Ignore_Funcs=$sSort_Callback

;~  Local Const $LVM_GETHEADER = (0x1000 + 31) ; 0x101F
    Local $hHeader =  HWnd(GUICtrlSendMsg($ControlID, 0x101F, 0, 0))

    Local $hWnd = GUICtrlGetHandle($ControlID)
"	Bug	new		Standard UDFs	3.3.14.5	None			
