如何改变一个EXE文件的图标
如何改变一个EXE文件的图标?
当然是任何一个WIN32应用程序的图标!
问题点数:0、回复次数:11Top
1 楼tong04(天涯)回复于 2003-02-03 15:15:39 得分 0
通过编程实现改其它文件的图标
不是在VB 编译时更改自身的图标
应该有API的方法实现这一功能吧!
Top
2 楼sippey(sippey)回复于 2003-02-03 15:22:11 得分 0
找本写pe应用程序结构的书看看
也可以用RES HACKER(一个不错的工具)Top
3 楼tong04(天涯)回复于 2003-02-03 15:24:08 得分 0
自己编程不用别的工具软件,能吗?
Top
4 楼ckc(火)回复于 2003-02-04 08:59:47 得分 0
当然可以,不过比较复杂
找个资源编译器之类的东西改要容易的多Top
5 楼zyl910(编程的乐趣在于编程控制硬件,与用图形学实现绚丽效果)回复于 2003-02-04 10:25:27 得分 0
当然能
需要你熟悉PE文件格式Top
6 楼mjcom(不明飞行物)回复于 2003-02-04 10:46:57 得分 0
这需要PE文件的格式,这里向你介绍一个好用的软件《资源黑客》
英文名为:RES HACKER
可以将Win32的PE文件(*.EXE,*.DLL,*.vxd)等文件的资源取出、编辑、并保存!
资源包括:
图标资源
指针资源
菜单资源
声音资源
和一些其它资源,更可怕的是,它还可以向PE文件添加自己的控件,更改原有的
字符资源(如:版权信息等)
。。。。。我们程序员没有什么“名节”可言了!Top
7 楼earthpea(问莲根,有丝多少?莲心知为谁苦?)回复于 2003-02-04 11:09:43 得分 0
自己编的话,你就要很熟悉pe文件格式的,要考虑到一个图标,多个图标等多种情况了。Top
8 楼dengwei007(邓蔚)回复于 2003-02-08 10:28:18 得分 0
这个问题我以前问过的了。
MSDN中的解决方法是:
Updating Resources
The following example copies a dialog box resource from one executable file, Hand.exe, to another, Foot.exe, by following these steps:
Use the LoadLibrary function to load the executable file Hand.exe.
Use the FindResource and LoadResource functions to locate and load the dialog box resource.
Use the LockResource function to retrieve a pointer to the dialog box resource data.
Use the BeginUpdateResource function to open an update handle to Foot.exe.
Use the UpdateResource function to copy the dialog box resource from Hand.exe to Foot.exe.
Use the EndUpdateResource function to complete the update.
The following code implements these steps.
HRSRC hResLoad; // handle to loaded resource
HANDLE hExe; // handle to existing .EXE file
HRSRC hRes; // handle/ptr. to res. info. in hExe
HANDLE hUpdateRes; // update resource handle
char *lpResLock; // pointer to resource data
BOOL result;
// Load the .EXE file that contains the dialog box you want to copy.
hExe = LoadLibrary("hand.exe");
if (hExe == NULL)
{
ErrorHandler("Could not load exe.");
}
// Locate the dialog box resource in the .EXE file.
hRes = FindResource(hExe, "AboutBox", RT_DIALOG);
if (hRes == NULL)
{
ErrorHandler("Could not locate dialog box.");
}
// Load the dialog box into global memory.
hResLoad = LoadResource(hExe, hRes);
if (hResLoad == NULL)
{
UpdateResource在VB中的声明是:
Public Declare Function UpdateResource Lib "kernel32" Alias "UpdateResourceA" (ByVal hUpdate As Long, ByVal lpType As String, ByVal lpName As String, ByVal wLanguage As Long, lpData As Any, ByVal cbData As Long) As Long
Top
9 楼tong04(天涯)回复于 2003-02-08 16:19:16 得分 0
dengwei007(邓蔚) : 解释一下您的代码吗?
Top
10 楼tong04(天涯)回复于 2003-02-08 16:21:08 得分 0
是C呀用VB能不能啊Top
11 楼ricemaster(饭盆)回复于 2003-02-08 22:51:09 得分 0
Public Declare Function UpdateResource Lib "kernel32" Alias "UpdateResourceA" (ByVal hUpdate As Long, ByVal lpType As String, ByVal lpName As String, ByVal wLanguage As Long, lpData As Any, ByVal cbData As Long) As Long
怎么用啊?关注!!Top




