I have a test script that works correctly by running the .au3 and by compiling it in x86 mode. However, it does not display icons when compiled in x64 mode and running on an x64 machine. What am I missing???
$FILE = "C:\Windows\System32\shell32.dll"
;Constants
Global Const $LV_VIEW_DETAILS = 0x0001
Global Const $LV_VIEW_ICON = 0x0000
Global Const $LV_VIEW_LIST = 0x0003
Global Const $LV_VIEW_SMALLICON = 0x0002
Global Const $LV_VIEW_TILE = 0x0004
Global Const $LVM_FIRST = 0x1000
Global Const $LVM_SETVIEW = ($LVM_FIRST + 142)
;GUI Window
GUICreate("test", 1014, 730)
;Listview
$hLV_ICON_LISTVIEW = GUICtrlCreateListView("", 10, 60, 995, 586)
_GUICtrlListView_SetView($hLV_ICON_LISTVIEW, 1)
GUISetState()
For $i = -1 to -10 Step -1
GUICtrlCreateListViewItem($i, $hLV_ICON_LISTVIEW)
GUICtrlSetImage(-1, $FILE, $i)
Next
While 1
sleep(2000)
Wend
Func _GUICtrlListView_SetView($hWnd, $iView) ;GuiListView.au3 (modified)
Local $aView[5] = [$LV_VIEW_DETAILS, $LV_VIEW_ICON, $LV_VIEW_LIST, $LV_VIEW_SMALLICON, $LV_VIEW_TILE]
If IsHWnd($hWnd) Then
Return _SendMessage($hWnd, $LVM_SETVIEW, $aView[$iView]) <> -1
Else
Return GUICtrlSendMsg($hWnd, $LVM_SETVIEW, $aView[$iView], 0) <> -1
EndIf
EndFunc
Func _SendMessage($hWnd, $iMsg, $wParam = 0, $lParam = 0, $iReturn = 0, $wParamType = "wparam", $lParamType = "lparam", $sReturnType = "lparam") ;SendMessage.au3
Local $aResult = DllCall("user32.dll", $sReturnType, "SendMessage", "hwnd", $hWnd, "int", $iMsg, $wParamType, $wParam, $lParamType, $lParam)
If @error Then Return SetError(@error, @extended, "")
If $iReturn >= 0 And $iReturn <= 4 Then Return $aResult[$iReturn]
Return $aResult
EndFunc