为什么运行
#include <GUIListView.au3>
#include <GUIImageList.au3>
#include <WinAPIEx.au3>
#include <WindowsConstants.au3>
#include <File.au3>
Dim $folder = FileSelectFolder('请选择目标文件夹', '', 4, @MyDocumentsDir)
If @error Then Exit (Msgbox(48, '退出', '没有选择文件夹,退出'))
Dim $a = _FileListToArray($folder, '*', 1)
If $a = 0 Then Exit (Msgbox(48, '退出', '没有选择文件夹,退出'))
GUICreate('MyIconGUI', 280, 400)
$ListView = GUICtrlCreateListView('', 10, 10, 260, 344, $LVS_NOCOLUMNHEADER)
_GUICtrlListView_SetView($ListView, 1)
_GUICtrlListView_InsertColumn($ListView, 0, '', 220)
$hImageList = _GUIImageList_Create(32, 32, 6)
_GUICtrlListView_SetImageList($ListView, $hImageList, 0)
$Button = GUICtrlCreateButton('退出', 105, 361, 70, 23)
For $i = 1 To $a[0]
$Ext = $folder & '\' & $a[$i]
$tSHFILEINFO = _WinAPI_ShellGetFileInfo($Ext, BitOR($SHGFI_ICON, $SHGFI_USEFILEATTRIBUTES))
$hIcon = DllStructGetData($tSHFILEINFO, 'hIcon')
_GUIImageList_ReplaceIcon($hImageList, -1, $hIcon)
_GUICtrlListView_AddItem($ListView, $a[$i], $i -1)
_WinAPI_FreeIcon($hIcon)
Next
GUISetState()
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case -3, $Button
ExitLoop
EndSwitch
WEnd
复制代码
出现D:\Program Files\autoit3\Include\WinAPIEx.au3(308,35) : ERROR: $PROCESS_VM_READ previously declared as a 'Const'
Global Const $PROCESS_VM_READ=0x10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Program Files\autoit3\Include\WinAPIEx.au3(309,48) : ERROR: $PROCESS_QUERY_INFORMATION previously declared as a 'Const'
Global Const $PROCESS_QUERY_INFORMATION = 0x400
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Program Files\autoit3\新建 AutoIt v3 脚本.au3 - 2 error(s), 0 warning(s)
($Li
如何解决? |