sanmoking
发表于 2010-2-5 11:48:37
能用是能用,在gui上创建一个gdi环境
netegg 发表于 2010-2-5 10:33 http://www.autoitx.com/images/common/back.gif
:face (18):不会
:face (38):
netegg
发表于 2010-2-5 11:59:31
回复 31# sanmoking
不好意思,我也不会:face (31):
afan
发表于 2010-2-5 23:39:51
额也不会……
_WinAPI_ShellGetFileInfo , DllStructGetData 后返回的 $hIcon 是图标的句柄,不知道用 GUICtrlSendMsg 操作可不可行。
qwg192800
发表于 2010-2-6 14:29:03
差函数文件啊
afan
发表于 2010-3-8 13:10:56
回复 34# qwg192800
WinAPIEx.au3
http://www.autoitx.com/forum.php?mod=redirect&mod=redirect&goto=findpost&ptid=13095&pid=138306&fromuid=7644923
jonyzhr
发表于 2010-8-9 08:59:03
运行出错,提示$tSHFILEINFO = _WinAPI_ShellGetFileInfo($Ext, BitOR($SHGFI_ICON, $SHGFI_USEFILEATTRIBUTES))
调用参数错误。
itljl
发表于 2010-8-22 14:09:14
回复 36# jonyzhr
的确。。。
mfknui
发表于 2010-8-23 17:59:05
先收了。以后用得到
afan
发表于 2010-8-23 18:08:36
运行出错,提示$tSHFILEINFO = _WinAPI_ShellGetFileInfo($Ext, BitOR($SHGFI_ICON, $SHGFI_USEFILEATTRIBU ...
jonyzhr 发表于 2010-8-9 08:59 http://www.autoitx.com/images/common/back.gif
回复jonyzhr
的确。。。
itljl 发表于 2010-8-22 14:09 http://www.autoitx.com/images/common/back.gif
比较老的帖子了,_WinAPI_ShellGetFileInfo() 现在的版本参数设置不同,要自行修改~
如果不想修改,就用 35# 提供的原 WinAPIEx.au3
neity
发表于 2011-2-11 21:28:54
Func _GUIImageList_AddAssociatedIcon($hWnd, $sPath, $fSmall = 0)
Local $Index, $Flags = $SHGFI_ICON, $tInfo = DllStructCreate($tagSHFILEINFO)
If Not _WinAPI_PathIsDirectory($sPath) Then
$Flags = BitOR($Flags, $SHGFI_USEFILEATTRIBUTES)
EndIf
If $fSmall Then
$Flags = BitOR($Flags, $SHGFI_SMALLICON)
EndIf
_WinAPI_ShellGetFileInfo($sPath, $Flags, 0, $tInfo)
If @error Then
Return SetError(1, 0, -1)
EndIf
$hIcon = DllStructGetData($tInfo, 'hIcon')
$Index = _GUIImageList_ReplaceIcon($hWnd, -1, $hIcon)
_WinAPI_DestroyIcon($hIcon)
Return $Index
EndFunc ;==>_GUIImageList_AddAssociatedIcon
guang19831217
发表于 2011-2-17 18:51:11
学习下,看看先。
浪迹红客
发表于 2011-3-10 19:24:01
为什么运行
#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
$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
如何解决?
nerdpal
发表于 2011-5-2 14:17:10
本帖最后由 nerdpal 于 2011-5-2 14:21 编辑
运行出错,提示$tSHFILEINFO = _WinAPI_ShellGetFileInfo($Ext, BitOR($SHGFI_ICON, $SHGFI_USEFILEATTRIBU ...
jonyzhr 发表于 2010-8-9 08:59 http://www.autoitx.com/images/common/back.gif
#include <WinAPIEx.au3>
Error :函数call里面包含错误的参数
#include "WinAPIEx.au3"
Lin 308 ... WinAPIEx.au3
Global Const $PROCESS_VM_READ=0x10
Global Const ^Error
Error : 不能重新声明一个常量
哪位帮忙解决一下啊,多谢
nerdpal
发表于 2011-5-2 14:26:34
自己解决了, 在WinAPIEx.au3中注释Lin 308-309
#include "WinAPIEx.au3"
;Global Const $PROCESS_VM_READ=0x10
;Global Const $PROCESS_QUERY_INFORMATION = 0x400
iamwonvy
发表于 2011-5-5 13:52:25
为什么我运行后有错误
_WinAPI_ShellGetFileInfo() 调用参数的数量错误.