1、如果文件的后缀名是“EXE”或“ICO”或“SCR”,直接用命令提取加入(); 2、若不是前3种后缀名,要先用命令取文本注册项()找类型注册项名,再用取文本注册项()找文件类型名,再用取文本注册项()找文件图标信息,对所取出的信息用逗号“。
1、如果文件的后缀名是“EXE”或“ICO”或“SCR”,直接用命令提取加入();
2、若不是前3种后缀名,要先用命令取文本注册项()找类型注册项名,再用取文本注册项()找文件类型名,再用取文本注册项()找文件图标信息,对所取出的信息用逗号“,”分割,前半部分是文件文件路径,后半部分是图标索引,最后再用提取加入()。
Option Explicit
Private Declare Function ExtractIcon Lib "shell32dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Sub Command1_Click()
Static total As Long, p(50) As Long, i As Integer, filename As String
filename = "d:\aexe"
total = ExtractIcon(ApphInstance, filename, -1)
'取得总图标数
For i = 0 To total - 1
p(i) = ExtractIcon(ApphInstance, filename, i) '读取每个图标
Next i
For i = 0 To total - 1 '依次显示每个图标
DrawIcon Picture1hdc, 34 i, 0, p(i)
Next i
DrawIcon Picture2hdc, 0, 0, p(0) '这个是显示exe本身图标的··
End Sub
typedef int (WINAPI ICEPUB_GETICONFROMFILE)(char strFilename,char strIconFilename);
ICEPUB_GETICONFROMFILE icePub_getIconFromfile = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDlldll");
if(hDLLDrv)
{
icePub_getIconFromfile = (ICEPUB_GETICONFROMFILE )GetProcAddress(hDLLDrv, "icePub_getIconFromfile");
}
icePub_getIconFromfile("E:\\icePubDlldll", "E:\\aico");
icePub_getIconFromfile("E:\\iceIpCheckexe", "E:\\bico");
if(hDLLDrv)
FreeLibrary(hDLLDrv);
>
图标小精灵
>
以上就是关于易语言,取快捷方式 .lnk 所用的图标 参考,取.exe时的源码 图标地址 = 取文全部的内容,包括:易语言,取快捷方式 .lnk 所用的图标 参考,取.exe时的源码 图标地址 = 取文、易语言取EXE文件图标、VB中如何获得其它exe文件的图标等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)