Win32 Application中怎么插入图标资源

来源:百度知道 编辑:UC知道 时间:2024/06/27 08:08:54
在Win32 Application中没有MFC里的ICON资源,怎么插入,我想改图标,教个方法也行。
还有别的方法吗?给个说解,谢谢,不要复制的,
问题补充,你们说的东东都好高深哦,我看不懂呢。有能帮到我的吗?

ICON资源在Win32 Application也是有的啊,
如果你用VC6.0的话,Insert菜单->Resource,在弹出的对话框内选择Icon,然后点击New,就可以新建一个图标了,点击Inport可以插入一个现有的.ico图标。

然后程序会自动生成一个.rc的资源文件,保存这个文件就可以了使用你的图标资源了。

举个例子吧(就看下面中文注释的那部分好了)
// DEMO2_3.CPP - A complete windows program
// INCLUDES ///////////////////////////////////////////////
#define WIN32_LEAN_AND_MEAN // just say no to MFC

#include <windows.h> // include all the windows headers
#include <windowsx.h> // include useful macros
#include <stdio.h>
#include <math.h>
#include "resource.h"

// DEFINES ////////////////////////////////////////////////
// defines for windows
#define WINDOW_CLASS_NAME "WINCLASS1"

// GLOBALS ////////////////////////////////////////////////

// FUNCTIONS //////////////////////////////////////////////
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,