用eXeScope啊! 首先,你把Shell32dll备份出来(从备份中提取),eXeScope打开,定位到你备份的shell32dll下,打开后把“资源”菜单展开,定位到“图标”,在里面找到你需要的图标后,选中它,并单击“文件(F)”选择“导出(E)”这是就可以把你需要的图标提取成ico格式的了,把文件保存到你需要的位置即可。
使用软件工具 如IcoFX 地址自己搜吧 功能很强大
可以提取程序中所有图标文件
文件 菜单 提取 打开原始程序 (exe或dll文件)即可看到 提取后保存即可 也可以批量处理 功能很多 慢慢摸索吧
所有图标文件都是内嵌在exe或dll文件中的 你到底想要什么 如果是系统默认关联图标 那得看是什么程序负责打开它 你找到那个关联它的程序的可执行文件exe或动态链接库文件dll 用提取软件打开它 你说的mp3图标 好多种呢 不同系统默认的也不一样 默认关联程序是windows media player 一般系统图标都在C:\WINDOWS\system32 shell32dll这个文件中 默认bmp图标是由系统的和传真查看器来关联的 文件是shimgvwdll 打开看看吧
'SavePicture方法保存ico图标时会失真,他保存真彩色时候会自动把图标转换成256色,这也是这个方法保存ico的不足,除非自己懂ico文件结构,把ico图标数据自己写到文件中,否则该函数会自动将真彩色
转换
256色保存,放在picturebox中的已经不是ico图标了,那是bmp,即使把bmp背景去掉还是要显示出来,ico里面有2张位图,一张是真图,另一张是掩码图(掩码图就是在显示的时候去除真图中不该显示的地方,比如说把ico图标放在桌面显示,系统会将ico的真图和掩码图拿出来,通过掩码图进行一种图像的叠加计算,让真图不该显示的地方去掉,让这个去掉的地方显示桌面的背景图)
Private
Type
PicBmp
Size
As
Long
tType
As
Long
hBmp
As
Long
hPal
As
Long
Reserved
As
Long
End
Type
Private
Type
GUID
Data1
As
Long
Data2
As
Integer
Data3
As
Integer
Data4(7)
As
Byte
End
Type
Private
Declare
Function
ExtractIcon&
Lib
"shell32dll"
Alias
"ExtractIconA"
(ByVal
hInst
As
Long,
ByVal
lpszExeFileName
As
String,
ByVal
nIconIndex
As
Long)
Private
Declare
Function
OleCreatePictureIndirect
Lib
"olepro32dll"
(PicDesc
As
PicBmp,
RefIID
As
GUID,
ByVal
fPictureOwnsHandle
As
Long,
IPic
As
Picture)
As
Long
Private
Declare
Function
ExtractIconEx
Lib
"shell32dll"
Alias
"ExtractIconExA"
(ByVal
lpszFile
As
String,
ByVal
nIconIndex
As
Long,
phiconLarge
As
Long,
phiconSmall
As
Long,
ByVal
nIcons
As
Long)
As
Long
Private
Declare
Function
DestroyIcon
Lib
"user32"
(ByVal
hIcon
As
Long)
As
Long
Public
Function
GetIconFromFile(FileName
As
String)
As
Picture
Dim
hlargeicon
As
Long,
hsmallicon
As
Long,
selhandle
As
Long
Dim
pic
As
PicBmp,
IPic
As
IPicture,
IID_IDispatch
As
GUID
selhandle
=
ExtractIcon(0,
FileName,
0)
If
selhandle
>
0
Then
With
IID_IDispatch
Data1
=
&H20400
Data4(0)
=
&HC0
Data4(7)
=
&H46
End
With
With
pic
Size
=
Len(pic)
tType
=
vbPicTypeIcon
hBmp
=
selhandle
End
With
Call
OleCreatePictureIndirect(pic,
IID_IDispatch,
0,
IPic)
Picture1Picture
=
IPic
Set
GetIconFromFile
=
IPic
DestroyIcon
hsmallicon
DestroyIcon
hlargeicon
End
If
End
Function
Private
Sub
Form_Load()
SavePicture
GetIconFromFile("exe文件路径"),
"保存的位置ico"
End
Sub
以上就是关于如何从dll文件中提取图标全部的内容,包括:如何从dll文件中提取图标、怎样提取文件关联的图标,如.mp3,.bmp这样文件类型的图标....、VB 提取exe 中的图标(ICO)等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)