找回密码
 加入
搜索
查看: 2775|回复: 9

_WinAPI_ShellExtractIcon图标问题(已解决)

  [复制链接]
发表于 2012-8-18 17:51:16 | 显示全部楼层 |阅读模式
本帖最后由 afan 于 2012-8-19 20:15 编辑

问题
我的DLL文件里存有三个ICO文件,,
#include <GuiListView.au3>
#include <GuiImageList.au3>
#Include <WinAPIEx.au3>


GUICreate("xxxxxxxx", 360,100)
$hListView = GUICtrlCreateListView("", 8, 8, 345,80)
GUICtrlSendMsg(-1,$LVM_SETVIEW,0,0)
GUISetState()

$hImage = _GUIImageList_Create(48,48,5,3)
_GUICtrlListView_SetImageList($hListView, $hImage, 0)
Local $hIcon = _WinAPI_ShellExtractIcon("D:\嘟嘟牛\ICO.DLL",0,48,48)
ConsoleWrite(_GUIImageList_ReplaceIcon($hImage, -1, $hIcon) & @CRLF)

_GUICtrlListView_AddColumn($hListView, "Items")

_WinAPI_DestroyIcon($hIcon) 

_GUICtrlListView_AddItem($hListView,"aaaaa", -1)
_GUICtrlListView_AddItem($hListView,"bbbbbbb", -2)
_GUICtrlListView_AddItem($hListView,"ccccccc",-3)



While GUIGetMsg() <>-3
WEnd



问题
如何DLL里的三个ICO放到对应的aaaaa bbbbb cccccc 上,现在只会出现一个图标

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2012-8-18 19:04:59 | 显示全部楼层
_WinAPI_ShellExtractIcon ( $sIcon, $iIndex, $iWidth, $iHeight )
$iIndex 图标的索引.
有3个的ICO话值从0到2
 楼主| 发表于 2012-8-18 19:31:26 | 显示全部楼层
回复 2# seniors


    从0到2试过也不行,,


没有下载下来试过???
发表于 2012-8-18 19:50:42 | 显示全部楼层
回复 3# lhy6456210
没有下载,这个你慢慢调试,或者0,-1,-2看看
另:你的GUIImageList用的不好
 楼主| 发表于 2012-8-18 19:55:57 | 显示全部楼层
回复 4# seniors


  0 1 2 -1 -N都试过,都不行,

你的GUIImageList用的不好   这个暂不讨论,,

麻烦您下载附件帮忙测试
发表于 2012-8-18 22:28:38 | 显示全部楼层
奇怪的DLL,我这边一个都不显示,都空白。。。。
发表于 2012-8-18 22:43:30 | 显示全部楼层
你的图标应该是有问题的,请参考
#include <GuiListView.au3>
#include <GuiImageList.au3>
#Include <WinAPIEx.au3>
GUICreate("xxxxxxxx", 360,100)
$hListView = GUICtrlCreateListView("", 8, 8, 345,80)
GUICtrlSendMsg(-1,$LVM_SETVIEW,0,0)
GUISetState()
$hImage = _GUIImageList_Create(48,48,5,3)
_GUICtrlListView_SetImageList($hListView, $hImage, 0)
Local $hIcon[4]
For $i = 1 To 3
$hIcon[$i]= _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll',$i,32,32)
ConsoleWrite(_GUIImageList_ReplaceIcon($hImage, -1, $hIcon[$i]) )
Next
For $ii = 1 To 3
_GUICtrlListView_AddItem($hListView,$ii, $ii-1)
Next
While GUIGetMsg() <>-3
WEnd
发表于 2012-8-19 08:53:53 | 显示全部楼层

#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WinAPIEx.au3>
GUICreate("xxxxxxxx", 560, 180)
$hListView = GUICtrlCreateListView("", 8, 8, 545, 150)
GUICtrlSendMsg(-1, $LVM_SETVIEW, 0, 0)
GUISetState()
$hImage = _GUIImageList_Create(128, 128, 5, 3)
_GUICtrlListView_SetImageList($hListView, $hImage, 0)
Local $hIcon
For $i = 0 To 2
        $hIcon = _WinAPI_ShellExtractIcon("ico.dll", $i, 128, 128)
        ConsoleWrite(_GUIImageList_ReplaceIcon($hImage, -1, $hIcon) & @CRLF)
Next
_GUICtrlListView_AddColumn($hListView, "Items")
_WinAPI_DestroyIcon($hIcon)
_GUICtrlListView_AddItem($hListView, "a", 0)
_GUICtrlListView_AddItem($hListView, "b", 1)
_GUICtrlListView_AddItem($hListView, "c", 2)
While GUIGetMsg() <> -3
WEnd

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2012-8-19 19:40:58 | 显示全部楼层
回复 9# haijie1223


    谢谢您,可以了
发表于 2012-8-24 21:02:35 | 显示全部楼层
看看我在it天空发的帖子,很简单,支持xp和win7

http://bbs.itiankong.com/thread-209067-1-1.html
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-30 01:35 , Processed in 0.090589 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表