如何提取程序的ICO图标!最好给个源码!
发布网友
发布时间:2022-04-29 16:26
我来回答
共1个回答
热心网友
时间:2023-05-31 02:02
原型:
int WINAPI icePub_getIconFromfile(char *strFilename,char *strIconFilename)
输入:strFilename 带图标资源文件名(DLL,EXE…)
strIconFilename icon图标图像文件名(.ico)
输出:
VC sample代码:
typedef int (WINAPI ICEPUB_GETICONFROMFILE)(char *strFilename,char *strIconFilename);
ICEPUB_GETICONFROMFILE *icePub_getIconFromfile = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_getIconFromfile = (ICEPUB_GETICONFROMFILE *)GetProcAddress(hDLLDrv, "icePub_getIconFromfile");
}
icePub_getIconFromfile("E:\\icePubDll.dll", "E:\\a.ico");
icePub_getIconFromfile("E:\\iceIpCheck.exe", "E:\\b.ico");
if(hDLLDrv)
FreeLibrary(hDLLDrv);
VB sample 代码:
Private Declare Function icePub_getIconFromfile Lib "icePubDll.dll" (ByVal strFilename As String, ByVal strIconFilename As String) As Integer
Dim a2 As Integer
a2 = icePub_getIconFromfile("E:\icePubDll.dll", "E:\a.ico")
a2 = icePub_getIconFromfile("E:\iceIpCheck.exe", "E:\b.ico")