找回密码
 加入
搜索
楼主: lhy6456210

[AU3基础] 求助_GUIImageList_AddIcon加截ICO出现马赛克

 火... [复制链接]
发表于 2012-7-17 09:25:43 | 显示全部楼层
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <winapiex.au3>

$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
        Local $hImage, $hListView

        GUICreate("ListView Set Outline Color", 800, 600)
        $hListView = GUICtrlCreateListView("", 2, 2, 780,580)
        GUICtrlSetStyle($hListView, $LVS_ICON)
        ; Enable extended control styles
        _GUICtrlListView_SetExtendedListViewStyle($hListView, $LVS_EX_BORDERSELECT)
        GUISetState()

        ; Load images
        $hImage = _GUIImageList_Create(48,48,5,1)
        _GUIImageList_Add($hImage, __GUIImageList_AddIcon($hImage,"ico.ico",0))
                _GUICtrlListView_SetImageList($hListView, $hImage, 0)

        ; Add columns
        _GUICtrlListView_AddColumn($hListView, "Items")
        

        ; Add items
        _GUICtrlListView_AddItem($hListView, "A01", 0)
        _GUICtrlListView_AddItem($hListView, "A02", 0)
        _GUICtrlListView_AddItem($hListView, "A03", 0)
        _GUICtrlListView_AddItem($hListView, "A04", 0)
        _GUICtrlListView_AddItem($hListView, "A04", 0)
        _GUICtrlListView_AddItem($hListView, "A04", 0)
        _GUICtrlListView_AddItem($hListView, "A04", 0)
        _GUICtrlListView_AddItem($hListView, "A01", 0)
        _GUICtrlListView_AddItem($hListView, "A02", 0)
        _GUICtrlListView_AddItem($hListView, "A03", 0)
        _GUICtrlListView_AddItem($hListView, "A04", 0)
        _GUICtrlListView_AddItem($hListView, "A04", 0)
        _GUICtrlListView_AddItem($hListView, "A04", 0)
        _GUICtrlListView_AddItem($hListView, "A04", 0)

        ; Set outline color
        _GUICtrlListView_SetOutlineColor($hListView, 0x0000FF)


        ; Loop until user exits
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
EndFunc   ;==>_Main


Func __GUIImageList_AddIcon($hWnd, $sFile, $iIndex = 0)
        Local $iRet
        $iRet = _WinAPI_ShellExtractIcon($sFile, $iIndex, _GUIImageList_GetIconWidth($hWnd), _GUIImageList_GetIconWidth($hWnd))
        If $iRet <= 0 Then Return SetError(-1, $iRet, 0)

        Local $hIcon = $iRet
        $iRet = _GUIImageList_ReplaceIcon($hWnd, -1, $hIcon)
        _WinAPI_DestroyIcon($hIcon)
        If $iRet = -1 Then Return SetError(-2, $iRet, 0)
        Return $iRet
EndFunc   ;==>__GUIImageList_AddIcon
发表于 2012-8-15 18:47:02 | 显示全部楼层
会载入位图吗?
发表于 2013-3-19 15:59:44 | 显示全部楼层
侃侃,正需要的资料
发表于 2013-6-13 17:52:41 | 显示全部楼层
回复 6# benkel

看看这个。。。。。。。。。。。。
发表于 2013-6-15 17:45:15 | 显示全部楼层
为了看隐藏代码
发表于 2013-6-15 17:45:23 | 显示全部楼层
为了看隐藏代码
发表于 2014-10-9 18:07:42 | 显示全部楼层
最近正在学习这方面的知识,也遇到类似的问题,很郁闷!
发表于 2014-10-13 22:28:15 | 显示全部楼层
回复 6# benkel


    看看源码~~
发表于 2018-1-10 05:17:18 | 显示全部楼层
来看厉害的回复的
发表于 2018-8-8 17:23:54 | 显示全部楼层
谢谢分享,。看看~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-27 06:58 , Processed in 0.071102 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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