#include
#include
#include
#include "resource.h"
#define CUR 0x1111 //新鼠标的id号
#define IDR_MENU 0x0999
LRESULT CALLBACK MYPROC(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam){
switch(msg){
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd,msg,wparam,lparam);
}
int WinMain(HINSTANCE hInstance,HINSTANCE hinstance,LPSTR lpCmdLine,int nShowCmd){
char* name = "name";
WNDCLASS wc = {0};
MSG msg;
HWND hwnd;
wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wc.hInstance = hInstance;
wc.lpfnWndProc = MYPROC;
wc.lpszClassName = name;
wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
wc.hCursor = LoadCursor(hInstance,MAKEINTRESOURCE(CUR));//鼠标样式的资源
RegisterClass(&wc);
hwnd = CreateWindowExA(WS_EX_CLIENTEDGE,name,TEXT("登陆界面"),WS_OVERLAPPEDWINDOW,500,100,500,700,NULL,LoadMenu(hInstance,MAKEINTRESOURCE(IDR_MENU)),hInstance,NULL);
ShowWindow(hwnd,nShowCmd);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0)){
TranslateMessage(&msg);
DispatchMessage(&msg);//分发消息,将消息分发给回调函数,回调函数callback处理完后,返回给dispatchmessage函数,再继续进行消息循环
}
return msg.message;
}
#编译没错,但是显示不出来菜单栏,求大神解答~