很简单,如下就成:
hbmp = (HBITMAP)LoadImage(ghInstance, MAKEINTRESOURCE(101), IMAGE_BITMAP, 0, 0,
LR_CREATEDIBSECTION);
其中:
HINSTANCE ghInstance;
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{ MSG msg;
char szClassName[]="MainWClass";
WNDCLASSEX wndclass;
ghInstance = hInstance; //就是程序的实例句柄。保存起来,方便以后使用
....................
}
MAKEINTRESOURCE(101); //一个宏,把资源ID号转换为字串描述