AppendMenu函数的使用方法,最好附例,谢了……

晕,我也在弄这个。。。


#define IDM_NEW 0x1002
#define IDM_EXIT 0x1003
#define IDM_HELP 0x1004
#define IDM_ABOUT 0x1005

hMenu = CreateMenu();
hFileMenu = CreateMenu();
hHelpMenu = CreateMenu();

AppendMenu(hFileMenu, MF_STRING, IDM_NEW, TEXT("新建"));
AppendMenu(hFileMenu, MF_STRING, IDM_EXIT, TEXT("退出"));
AppendMenu(hMenu, MF_POPUP, (LONG)hFileMenu, TEXT("游戏(G)"));

AppendMenu(hHelpMenu, MF_STRING, IDM_HELP, TEXT("查看帮助"));
AppendMenu(hHelpMenu, MF_STRING, IDM_ABOUT, TEXT("关于"));
AppendMenu(hMenu, MF_POPUP, (LONG)hHelpMenu, TEXT("帮助"));

SetMenu(hwnd, hMenu);

你可能感兴趣的:(windows内核,api)