| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1071 人关注过本帖, 2 人收藏
标题:求教一个不太专业的问题:如何提取Windows 11系统UI图标集?
只看楼主 加入收藏
cssnet
Rank: 5Rank: 5
等 级:职业侠客
威 望:5
帖 子:351
专家分:335
注 册:2013-10-4
结帖率:100%
收藏(2)
 问题点数:0 回复次数:7 
求教一个不太专业的问题:如何提取Windows 11系统UI图标集?
想让自己程序的UI尽量接近于最新版Windows,最简单的方法,那就是尽量借用/套用/盗用Windows系统自带的那一套UI图标。
尽量改换成最新版的,这样自己的软件——至少看上去——就没那么老土了。

搜了一下,Windows 10提取出来的图标库有下载,Win11的暂未找着。
搜“提取Win10系统图标的方法”,提到一个什么软件“软媒魔方 - 图标大师”,下载了一个绿色版试试,好像根本扫描不了win10的shell32.dll……这么看来,估计是我老人家的人品问题了。

好吧,求教:有没有现成的已提取好的Win11系统图标下载?
搜索更多相关主题的帖子: UI 系统 提取 图标 Windows 
2022-10-13 14:54
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10609
专家分:43210
注 册:2014-5-20
收藏
得分:0 
试试用 shell32 API
ExtractIcon()
ExtractAssociatedIcon()

SHELL32.dll里也有不少

[此贴子已经被作者于2022-10-13 16:19编辑过]

2022-10-13 16:18
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10609
专家分:43210
注 册:2014-5-20
收藏
得分:0 
搜了一下 system32 的文件
图片附件: 游客没有浏览图片的权限,请 登录注册

程序代码:
cDefPath = ADDBS(JUSTPATH(SYS(16)))
SET DEFAULT TO (cDefPath)

DECLARE long ExtractIcon IN shell32 as apiExtractIcon long,string,long
DECLARE long DestroyIcon IN user32 as apiDestroyIcon long
DECLARE long GetWindowsDirectory IN kernel32 as apiGetWindowsDirectory string@,long
DECLARE long GdiplusStartup            IN gdiplus as apiGdiplusStartup            long@,string@,long
DECLARE long GdiplusShutdown           IN gdiplus as apiGdiplusShutdown           long
DECLARE long GdipCreateBitmapFromHICON IN gdiplus as apiGdipCreateBitmapFromHICON long,long@
DECLARE long GdipDisposeImage          IN gdiplus as apiGdipDisposeImage          long
DECLARE long GdipSaveImageToFile       IN gdiplus as apiGdipSaveImageToFile       long,string,string,long

#define MAX_PATH         260
#define GWL_HINSTANCE    -6
#define CLSID_PNG        0h06F47C55041AD3119A730000F81EF32E

CREATE CURSOR sysTable (sysfile v(254), icoCount I, sysPath v(254))
CREATE CURSOR icoTable (img v(1), icoFile v(254), sysfile v(254), icoPath v(254))

stGSI = 0h01000000000000000000000000000000
pGDI  = 0
apiGdiplusStartup(@pGDI, @stGSI, 0)

cMsg = "获取数据,请稍候......"
WAIT cMsg NOWAIT NOCLEAR WINDOW AT WLROW()+WROWS()/2, WLCOL()+(WCOLS()-LEN(cMsg))/2 
    
winPath = SPACE(MAX_PATH)
len = apiGetWindowsDirectory(@winPath, MAX_PATH)
winPath = LEFT(winPath,len)+ "\system32\" 
FOR i=1 TO ADIR(aFile, winPath+"*.*", "AHS")
    fn = winPath + aFile[i,1]
    IF !FILE(fn) 
        LOOP  
    ENDIF   
    nCnt = apiExtractIcon(0, fn, -1)
    IF nCnt == 0
        LOOP 
    ENDIF 
    INSERT INTO sysTable VALUES (aFile[i,1], nCnt, winPath)
ENDFOR
num = 1
SELECT sysTable
SCAN
    fn = winPath + sysTable.sysFile
    FOR icoIndex=0 TO icoCount-1
        hIcon = apiExtractIcon(0, fn, icoIndex)
        hBitmap = 0
        apiGdipCreateBitmapFromHICON(hIcon, @hBitmap)
        outFile = "icon"+PADL(num,4,"0")+".png"
        num = num + 1
        apiGdipSaveImageToFile(hBitmap, STRCONV(cDefPath+outFile+0h00,5), CLSID_PNG, 0)
        apiGdipDisposeImage(hBitmap)
        apiDestroyIcon(hIcon)
        INSERT INTO icoTable VALUES ("", outFile, sysTable.sysFile, cDefPath)
    ENDFOR
ENDSCAN
GO TOP IN "sysTable"
GO TOP IN "icoTable"
WAIT CLEAR
of = CREATEOBJECT("icoForm")
of.show(1)
CLEAR RESOURCES
SELECT icoTable
SCAN      
    DELETE FILE (icoFile)
ENDSCAN
apiGdiplusShutdown(pGDI)
RETURN

DEFINE CLASS icoForm as Form
    width = 800
    height = 500
    ADD OBJECT icoGrid as icoGrid
    ADD OBJECT sysGrid as grid WITH left=301,width=500,height=500,RecordSource="sysTable"
    PROCEDURE init
        this.icoGrid.AutoFit()
        this.sysGrid.AutoFit()
    ENDPROC 
ENDDEFINE

DEFINE CLASS icoGrid as Grid 
    width = 300
    height = 500
    RecordSource = "icoTable"
    PROCEDURE init
        this.RowHeight = 32
        this.Column1.width = 32
        this.Column1.RemoveObject("text1")
        this.Column1.AddObject("img","icoImage")
        this.Column1.Sparse = .F.
    ENDPROC
ENDDEFINE

DEFINE CLASS icoImage as Image
    Stretch = 1
    PROCEDURE BackStyle_ACCESS
        this.picture = icoTable.icoFile
        RETURN this.BackStyle
    ENDPROC
ENDDEFINE

2022-10-14 00:00
csyx
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:火星
等 级:版主
威 望:37
帖 子:709
专家分:2848
注 册:2018-3-13
收藏
得分:0 
不是图标工具的问题,Win10 以后的系统图标不再在 shell32.dll,imagesres.dll,... 这些文件里,MS 开始耍无赖了,实际图标放在这个文件夹的同名(后缀再加一个mun)文件里
图片附件: 游客没有浏览图片的权限,请 登录注册

这家伙很懒,啥也没留下
2022-10-14 04:42
schtg
Rank: 12Rank: 12Rank: 12
来 自:Usa
等 级:贵宾
威 望:67
帖 子:1790
专家分:3389
注 册:2012-2-29
收藏
得分:0 
学习啦,谢谢!
2022-10-14 05:47
cssnet
Rank: 5Rank: 5
等 级:职业侠客
威 望:5
帖 子:351
专家分:335
注 册:2013-10-4
收藏
得分:0 
以下是引用csyx在2022-10-14 04:42:49的发言:
不是图标工具的问题,Win10 以后的系统图标不再在 shell32.dll,imagesres.dll,... 这些文件里,MS 开始耍无赖了,实际图标放在这个文件夹的同名(后缀再加一个mun)文件里


妙极,妙极!原来如此!感谢提示!
2022-10-14 10:57
cssnet
Rank: 5Rank: 5
等 级:职业侠客
威 望:5
帖 子:351
专家分:335
注 册:2013-10-4
收藏
得分:0 
吹版的武功当真深不可测!
不是我擦鞋——实在是一对靴子油光锃亮,端的煞是好看!
啧啧。

以下是引用吹水佬在2022-10-14 00:00:52的发言:
搜了一下 system32 的文件

cDefPath = ADDBS(JUSTPATH(SYS(16)))
SET DEFAULT TO (cDefPath)

DECLARE long ExtractIcon IN shell32 as apiExtractIcon long,string,long
DECLARE long DestroyIcon IN user32 as apiDestroyIcon long
DECLARE long GetWindowsDirectory IN kernel32 as apiGetWindowsDirectory string@,long
DECLARE long GdiplusStartup            IN gdiplus as apiGdiplusStartup            long@,string@,long
DECLARE long GdiplusShutdown           IN gdiplus as apiGdiplusShutdown           long
DECLARE long GdipCreateBitmapFromHICON IN gdiplus as apiGdipCreateBitmapFromHICON long,long@
DECLARE long GdipDisposeImage          IN gdiplus as apiGdipDisposeImage          long
DECLARE long GdipSaveImageToFile       IN gdiplus as apiGdipSaveImageToFile       long,string,string,long

#define MAX_PATH         260
#define GWL_HINSTANCE    -6
#define CLSID_PNG        0h06F47C55041AD3119A730000F81EF32E

CREATE CURSOR sysTable (sysfile v(254), icoCount I, sysPath v(254))
CREATE CURSOR icoTable (img v(1), icoFile v(254), sysfile v(254), icoPath v(254))

stGSI = 0h01000000000000000000000000000000
pGDI  = 0
apiGdiplusStartup(@pGDI, @stGSI, 0)

cMsg = "获取数据,请稍候......"
WAIT cMsg NOWAIT NOCLEAR WINDOW AT WLROW()+WROWS()/2, WLCOL()+(WCOLS()-LEN(cMsg))/2
   
winPath = SPACE(MAX_PATH)
len = apiGetWindowsDirectory(@winPath, MAX_PATH)
winPath = LEFT(winPath,len)+ "\system32\"
FOR i=1 TO ADIR(aFile, winPath+"*.*", "AHS")
    fn = winPath + aFile[i,1]
    IF !FILE(fn)
        LOOP  
    ENDIF   
    nCnt = apiExtractIcon(0, fn, -1)
    IF nCnt == 0
        LOOP
    ENDIF
    INSERT INTO sysTable VALUES (aFile[i,1], nCnt, winPath)
ENDFOR
num = 1
SELECT sysTable
SCAN
    fn = winPath + sysTable.sysFile
    FOR icoIndex=0 TO icoCount-1
        hIcon = apiExtractIcon(0, fn, icoIndex)
        hBitmap = 0
        apiGdipCreateBitmapFromHICON(hIcon, @hBitmap)
        outFile = "icon"+PADL(num,4,"0")+".png"
        num = num + 1
        apiGdipSaveImageToFile(hBitmap, STRCONV(cDefPath+outFile+0h00,5), CLSID_PNG, 0)
        apiGdipDisposeImage(hBitmap)
        apiDestroyIcon(hIcon)
        INSERT INTO icoTable VALUES ("", outFile, sysTable.sysFile, cDefPath)
    ENDFOR
ENDSCAN
GO TOP IN "sysTable"
GO TOP IN "icoTable"
WAIT CLEAR
of = CREATEOBJECT("icoForm")
of.show(1)
CLEAR RESOURCES
SELECT icoTable
SCAN      
    DELETE FILE (icoFile)
ENDSCAN
apiGdiplusShutdown(pGDI)
RETURN

DEFINE CLASS icoForm as Form
    width = 800
    height = 500
    ADD OBJECT icoGrid as icoGrid
    ADD OBJECT sysGrid as grid WITH left=301,width=500,height=500,RecordSource="sysTable"
    PROCEDURE init
        this.icoGrid.AutoFit()
        this.sysGrid.AutoFit()
    ENDPROC
ENDDEFINE

DEFINE CLASS icoGrid as Grid
    width = 300
    height = 500
    RecordSource = "icoTable"
    PROCEDURE init
        this.RowHeight = 32
        this.Column1.width = 32
        this.Column1.RemoveObject("text1")
        this.Column1.AddObject("img","icoImage")
        this.Column1.Sparse = .F.
    ENDPROC
ENDDEFINE

DEFINE CLASS icoImage as Image
    Stretch = 1
    PROCEDURE BackStyle_ACCESS
        this.picture = icoTable.icoFile
        RETURN this.BackStyle
    ENDPROC
ENDDEFINE

2022-10-14 11:05
csyx
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:火星
等 级:版主
威 望:37
帖 子:709
专家分:2848
注 册:2018-3-13
收藏
得分:0 
win10刚出来不久的时候,我也遇到和你一样的困扰,百度了一圈全是抄来抄去的垃圾答案,后来还是翻墙用google才从鬼佬处得到答案,原来如此
图片附件: 游客没有浏览图片的权限,请 登录注册

这家伙很懒,啥也没留下
2022-10-14 12:38
快速回复:求教一个不太专业的问题:如何提取Windows 11系统UI图标集?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021176 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved