标签:
10.2.1 和菜单有关的概念
差别 |
主菜单(顶级菜单) |
子菜单(弹出菜单) |
|
被选中(checked) |
不能 |
可以 |
|
启用/禁用 (enabled/disabled) 活动/非活动(Active/Inactive) |
可以 |
可以 |
|
变灰(grayed) |
可以 |
可以 |
|
WM_COMMAND消息 |
启用时,可发送。禁用或变灰里不能 |
||
句柄 |
有独立句柄 |
有独立句柄 |
|
10.2.2 菜单项的结构和定义菜单——三个特征来定义菜单
特征 |
说明 |
①显示内容 |
1、表示文本字符串或位图。 2、带&指示紧接的字符显示下划线,配合Alt键搜索 3、Spparator绘制水平分隔线 4、\t制表符后面的文本在新一栏中 5、\a后面的文本进行右对齐 |
②ID |
该项为MENUITEM(菜单项):则为菜单ID,会发送WM_COMMAND 为POPUP(弹出菜单): 为菜单句柄 |
③属性 |
是否被禁用、变灰或选中等。非活动时,不会产生WM_COMMAND消息。 |
10.2.3 在程序中引用菜单
(1)窗口类定义:wndclass.lpszMenuName =szAppName; //这里不能用LoadMenu
(2)在CreatWindow中指定菜单
①先加载菜单
hMenu= LoadMenu(hInstance,TEXT(“MyMenu”);或
hMenu =LoadMenu(hInstance,MAKEINTRESOURCE(IDM_MENU));
②将hMenu指定给CreateWindows第9个参数
Hwnd =CreateWindow(TEXT(“MyClass”),TEXT(“Windows Caption”),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT,
NULL,hMenu,hInstance,NULL);
(3)窗口创建之后再指定的方法:SetMenu(hwnd,hMenu);
(4)菜单的销毁:①附加到窗口的菜单——自动销毁
②没有附加到窗口的——手动DestroyMenu
10.2.4 菜单与消息
消息 |
wParam |
lParam |
备注 |
|||||||||
WM_INITMENU |
主菜单句柄 |
0 |
即使是选择了系统菜单中的一项,wParam仍然是主菜单的句柄。 |
|||||||||
WM_MENUSELECT |
LOWORD:菜单ID或弹出菜单的索引 HIWORD:选择标记—— MF_GRAYED、MF_DISABLED、 MF_CHECKED、MF_BITMAP、 MF_POPUP、MF_HELP、 MF_SYSMENU、 MF_MOUSESELECT |
包含所选项的菜单句柄 (注意是包含所选项的 整个POPUP菜单的句 柄)。 |
选择标记为那些值的组合,当加亮显示条在菜单项之间移动时,发送WM_MENUSELECT消息。 |
|||||||||
WM_INITMENUPOPUP |
弹出菜单的句柄 |
LOWORD:弹出菜单的索引 HIWORD:1为系统菜单 0代表其他菜单 |
在弹出菜单之前,可以通过该消息设置菜单项的Enabled状态。 |
|||||||||
WM_COMMAND |
|
菜单时:0 控件时:子窗口句柄 |
对比菜单与控件发送WM_COMMAND的不同 |
|||||||||
WM_SYSCOMMAND |
1、菜单ID 2、对于预定义的系统菜单项:通过wParam&0xFFF0确 定哪项被选,结果如下 SC_SIZE、SC_MOVE、 SC_MINIMIZE、SC_MAXSIZE、 SC_RESTORE等 3、系统菜单添加的菜单项 LOWORD为菜单ID。定义 ID时要<0xF000以避免和预 定义菜单ID冲突 |
1、键盘选择菜单项时为0 2、鼠标单击时,lParam 表示鼠标的屏幕坐标, LOWORD为 x,HIWORD为y |
系统菜单发送的 |
|||||||||
WM_MENUCHAR |
LOWORD:字符码(ASCII或 Unicode)。 HIWORD:选择码——0表示 没有弹出菜单显示, MF_POPUP弹出菜单被显示, MF_SYSMENU系统弹出菜单 被显示 |
菜单句柄 |
1、不是真正的菜单消息 2、两种情况下发送该消息 ①Alt+不对应任何菜单项的字符键。 ②弹出菜单时,安了一个不对应任何弹出菜单项的字符键。 |
10.2.5 范例程序
(1)获取菜单句柄:
hMenu = GetMenu(hwnd); //己经设置了主菜单的情况下
hMenu = LoadMenu(hInstance,MAKEINTRESOURCE(IDM_MENUID));
(2)获取指定菜单激活的下拉式菜单或子菜单的句柄:
HMENU hSubMenu = GetSubMenu(hMenu,nPos); //该指定项在菜单内的相对位置
(3)设置弹出菜单:TrackPopupMenu(hMenu, TPM_RIGHTALIGN,x,y,hwnd,NULL);
(4)设置选中或取消选中状态
CheckMenuItem(hMenu,iSelection,MF_CHECKED); //iSelection为菜单ID
CheckMenuItem(hMenu,iSelection,MF_UNCHECKED);
CheckMenuItem(hMenu,iPosition,MF_UNCHECKED|MF_BYPOSITION); //iPosition为位置索引
(5)启动或禁用菜单
EnabledMenuItem(hMenu,IDM_MENUID,MF_GRAYED);//变灰
EnabledMenuItem(hMenu,IDM_MENUID,MF_ENABLED);//激活,禁用时用MF_DISABLED
EnabledMenuItem(hMenu,iPosition,MF_ENABLED|MF_BYPOSITION);// iPosition为位置索引
10.2.6 通过程序来定义菜单
(1)创建菜单 hMenu= CreateMenu();
(2)添加菜单项 ——要先hMenuPopup=CreateMenu();
AppendMenu(hMenuPopup,MF_STRING,IDM_MENIID,“&NEW”);//MF_标志可组合使用,如变灰
AppendMenu(hMenu,MF_SEPARATOR,0,NULL);
AppendMenu(hMenu,MF_POPUP,hMenuPopup,“&File”);
10.2.7 定义菜单的第3种方法:
(1)MENUITEMPLATE结构
(2)LoadMenuIndirect( CONST MENUTEMPLATE *lpMenuTemplate);
10.2.8 浮动弹出菜单
(1)顶级菜单只能包含一个菜单项:如“MyMenu”的弹出菜单.
(2)浮动弹出菜单:
TrackPopupMenu(hTrackMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
★注意鼠标坐标应转化为屏幕坐标
10.2.9 使用系统菜单
(1)新加的菜单项ID应<0xF000
(2)系统菜单发送:WM_SYSCOMMAND消息
(3)获取系统菜单的方法:HMENUGetSystemMenu(hWnd, bRevert);
10.2.10 菜单的其他命令
函数 |
功能 |
备注 |
AppendMenu |
在菜单末尾加入新菜单项 |
|
DeleteMenu |
删除菜单项并销毁 |
|
InsertMenu |
插入新菜单项 |
|
ModifyMenu |
修改己存在的菜单项 |
|
RemoveMenu |
去除一个己有的菜单项(不销毁) |
|
DestroyMenu |
销毁菜单 |
己被附加到顶级菜单的,会自动 Destroy,其他的要手动销毁 |
DrawMenuBar(hwnd) |
强制重绘顶级菜单 |
|
GetSubMenu(hMenu,iPosition) |
返回弹出菜单的句柄 |
iPosition是弹出菜单在顶级菜单中的索引(从0开始),hMenu为顶级菜单 |
GetMenuItemCount(hMenu) |
返回顶级菜单或弹出菜单的菜单项数目 |
|
GetMenuItemID(hMenuPopup,iPosition) |
获取弹出菜单中某个菜单项的菜单ID |
iPosition指该菜单在弹出菜单中的位置(从0开始) |
GetMenuString |
获取菜单项文本 |
第2个参数id可以是菜单ID或位置索引,看iFlag参数是MF_BYCOMMAND或MF_BYPOSITION |
GetMenuState |
获取菜单项的当前标志 返回值是各种标志的组合 |
id,iFlag参数意义如上 |
【MenuDemo程序】
/*------------------------------------------------------------ MENUDEMO.C -- Menu Demonstration (c) Charles Petzold, 1998 ------------------------------------------------------------*/ #include <windows.h> #include "resource.h" #define ID_TIMER 1 #define IDM_SYS_ABOUT 1 #define IDM_SYS_HELP 2 #define IDM_SYS_REMOVE 3 HINSTANCE hInst; TCHAR szAppName[] = TEXT("MenuDemo"); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { HWND hwnd; HMENU hSysMenu; //系统菜单 MSG msg; WNDCLASS wndclass; hInst = hInstance; wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wndclass.lpszMenuName = szAppName; //不能用LoadMenu wndclass.lpszClassName = szAppName; if (!RegisterClass(&wndclass)) { MessageBox(NULL, TEXT("This program requires Windows NT!"), szAppName, MB_ICONERROR); return 0; } hwnd = CreateWindow(szAppName, // window class name TEXT("Menu Demonstration"), // window caption WS_OVERLAPPEDWINDOW, // window style CW_USEDEFAULT, // initial x position CW_USEDEFAULT, // initial y position CW_USEDEFAULT, // initial x size CW_USEDEFAULT, // initial y size NULL, // parent window handle NULL, // window menu handle hInstance, // program instance handle NULL); // creation parameters hSysMenu = GetSystemMenu(hwnd, FALSE); AppendMenu(hSysMenu, MF_SEPARATOR, 0, 0); //加分隔线; AppendMenu(hSysMenu, MF_STRING, IDM_SYS_ABOUT, TEXT("&About...")); AppendMenu(hSysMenu, MF_STRING, IDM_SYS_HELP, TEXT("&Help...")); AppendMenu(hSysMenu, MF_STRING, IDM_SYS_REMOVE, TEXT("&Remove Additions")); ShowWindow(hwnd, iCmdShow); UpdateWindow(hwnd); while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { static int idColor[5] = { WHITE_BRUSH, LTGRAY_BRUSH, GRAY_BRUSH, DKGRAY_BRUSH, BLACK_BRUSH }; static int iSelection = IDM_BKGND_WHITE; //当前选中的颜色菜单项ID HMENU hMainMenu, hPopupMenu, hSrcMenu, hTrackMenu; TCHAR szBuf[24]; POINT pt; switch (message) { //case WM_CONTEXTMENU: //WM_RBUTTONUP、WM_NCRBUTTONUP 、Shift+F10时触发 case WM_RBUTTONUP: pt.x = LOWORD(lParam); pt.y = HIWORD(lParam); ClientToScreen(hwnd, &pt); hSrcMenu = LoadMenu(hInst, szAppName); //这里不能GetMenu,要从资源加载进来 hPopupMenu = CreatePopupMenu();//创建弹出式菜单 AppendMenu(hPopupMenu, MF_POPUP, (UINT_PTR)hSrcMenu, TEXT("MyMenu")); //浮动菜单需要唯一的弹出菜单 hTrackMenu = GetSubMenu(hPopupMenu, 0); TrackPopupMenu(hTrackMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL); DestroyMenu(hSrcMenu); //销毁加载的菜单 DestroyMenu(hPopupMenu);//销毁弹出式菜单 return 0; case WM_COMMAND: hMainMenu = GetMenu(hwnd); switch (LOWORD(wParam)) { case IDM_FILE_NEW: case IDM_FILE_OPEN: case IDM_FILE_SAVE: case IDM_FILE_SAVE_AS: wsprintf(szBuf, TEXT("Menu ID:%d!"), LOWORD(wParam)); MessageBox(hwnd, szBuf, szAppName, MB_ICONINFORMATION | MB_OK); return 0; case IDM_APP_EXIT: SendMessage(hwnd, WM_CLOSE, 0, 0); return 0; case IDM_EDIT_UNDO: case IDM_EDIT_CUT: case IDM_EDIT_COPY: case IDM_EDIT_PASTE: case IDM_EDIT_DELETE: wsprintf(szBuf, TEXT("Menu ID:%d!"), LOWORD(wParam)); MessageBox(hwnd, szBuf, szAppName, MB_ICONINFORMATION | MB_OK); return 0; case IDM_BKGND_WHITE: //假设从white到black是按顺序递增的 case IDM_BKGND_LIGHTG_RAY: case IDM_BKGND_GRAY: case IDM_BKGND_DARKGRAY: case IDM_BKGND_BLACK: CheckMenuItem(hMainMenu, iSelection, MF_UNCHECKED); //取消之前选中项的选中状态 iSelection = LOWORD(wParam); CheckMenuItem(hMainMenu, iSelection, MF_CHECKED); //设置当前项为选中状态 SetClassLong(hwnd, GCL_HBRBACKGROUND, (LONG)GetStockObject(idColor[LOWORD(wParam) - IDM_BKGND_WHITE])); InvalidateRect(hwnd, NULL, TRUE); return 0; case IDM_TIMER_START: if (SetTimer(hwnd, ID_TIMER, 1000, NULL)) { EnableMenuItem(hMainMenu, IDM_TIMER_START, MF_GRAYED); EnableMenuItem(hMainMenu, IDM_TIMER_STOP, MF_ENABLED); } return 0; case IDM_TIMER_STOP: if (KillTimer(hwnd, ID_TIMER)) { EnableMenuItem(hMainMenu, IDM_TIMER_START, MF_ENABLED); EnableMenuItem(hMainMenu, IDM_TIMER_STOP, MF_GRAYED); } return 0; case IDM_APP_ABOUT: MessageBox(hwnd, TEXT("Help not yet implement!"), szAppName, MB_ICONEXCLAMATION | MB_OK); return 0; case IDM_APP_ABOUT_MENUDEMO: MessageBox(hwnd, TEXT("Menu Demonstration Program!\n{c} Charles Petzold,1998"), //\n换行显示 szAppName, MB_ICONINFORMATION | MB_OK); return 0; } break; //其它WM_COMMAND进行默认处理,这里不return; case WM_SYSCOMMAND: switch (LOWORD(wParam)) //自定义的菜单ID在LOWORD中 { case IDM_SYS_ABOUT: MessageBox(hwnd, TEXT("A Poor-Person‘s Menu Program\n{c} Charles Petzold,1998!"), szAppName, MB_ICONINFORMATION | MB_OK); return 0; case IDM_SYS_HELP: MessageBox(hwnd, TEXT("Help not yet implement!"), szAppName, MB_ICONEXCLAMATION | MB_OK); return 0; case IDM_SYS_REMOVE: GetSystemMenu(hwnd, TRUE);//重置系统菜单,参数bRevert设为TRUE return 0; } break; //其它消息进行默认处理,这里不能return。 case WM_TIMER: MessageBeep(0); return 0; case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hwnd, message, wParam, lParam); }
//resource.h
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ 生成的包含文件。 // 供 MenuDemo.rc 使用 // #define IDM_FILE_NEW 40001 #define IDM_FILE_OPEN 40002 #define IDM_FILE_SAVE_AS 40003 #define IDM_FILE_SAVE 40004 #define IDM_APP_EXIT 40005 #define IDM_EDIT_UNDO 40006 #define IDM_EDIT_CUT 40007 #define IDM_EDIT_COPY 40008 #define IDM_EDIT_PASTE 40009 #define IDM_EDIT_DELETE 40010 #define IDM_BKGND_WHITE 40011 #define IDM_BKGND_LIGHTG_RAY 40012 #define IDM_BKGND_GRAY 40013 #define IDM_BKGND_DARKGRAY 40014 #define IDM_BKGND_BLACK 40015 #define IDM_TIMER_START 40016 #define IDM_TIMER_STOP 40017 #define IDM_APP_ABOUT 40018 #define IDM_APP_ABOUT_MENUDEMO 40019 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40052 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
//MenuDemo.rc
// Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // 中文(简体,中国) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""winres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Menu // MENUDEMO MENU //顶级菜单 BEGIN POPUP "&File" //注意与浮动弹出菜单的区别 BEGIN MENUITEM "&New", IDM_FILE_NEW MENUITEM "&Open", IDM_FILE_OPEN MENUITEM "Save &As...", IDM_FILE_SAVE_AS MENUITEM "&Save", IDM_FILE_SAVE MENUITEM SEPARATOR MENUITEM "E&xit", IDM_APP_EXIT END POPUP "&Edit" BEGIN MENUITEM "&Undo", IDM_EDIT_UNDO MENUITEM SEPARATOR MENUITEM "C&ut", IDM_EDIT_CUT MENUITEM "&Copy", IDM_EDIT_COPY MENUITEM "&Paste", IDM_EDIT_PASTE MENUITEM "De&lete", IDM_EDIT_DELETE END POPUP "&BackGround" BEGIN MENUITEM "&White", IDM_BKGND_WHITE, CHECKED MENUITEM "&Light Gray", IDM_BKGND_LIGHTG_RAY MENUITEM "&Gray", IDM_BKGND_GRAY MENUITEM "&Dark Gray", IDM_BKGND_DARKGRAY MENUITEM "&Black", IDM_BKGND_BLACK END POPUP "Timer" BEGIN MENUITEM "&Start", IDM_TIMER_START MENUITEM "S&top", IDM_TIMER_STOP, GRAYED END POPUP "Help" BEGIN MENUITEM "&Help...", IDM_APP_ABOUT MENUITEM "&About MenuDemo...", IDM_APP_ABOUT_MENUDEMO END END #endif // 中文(简体,中国) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED
(1)创建三个菜单
①主菜单:(有3个菜单项,但“MAIN:”被禁用)。
②文件菜单File和编辑菜单Edit如下
(2)在WM_COMMAND中进行通过SetMenu进行菜单切换。
(3)处理WM_DESTROY消息:
①销毁File和Edit菜单
②将主菜单设为程序的顶级菜单,这样当窗口销毁时,主菜单自动销毁。
【NoPopups程序】
/*------------------------------------------------------------ NOPOPUPS.C -- Demonstrates No-Popup Nested Menu (c) Charles Petzold, 1998 ------------------------------------------------------------*/ #include <windows.h> #include "resource.h" LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { static TCHAR szAppName[] = TEXT("NoPopups"); HWND hwnd; MSG msg; WNDCLASS wndclass; wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wndclass.lpszMenuName = NULL; wndclass.lpszClassName = szAppName; if (!RegisterClass(&wndclass)) { MessageBox(NULL, TEXT("This program requires Windows NT!"), szAppName, MB_ICONERROR); return 0; } hwnd = CreateWindow(szAppName, // window class name TEXT("No-Popup Nested Menu Demonstration"), // window caption WS_OVERLAPPEDWINDOW, // window style CW_USEDEFAULT, // initial x position CW_USEDEFAULT, // initial y position CW_USEDEFAULT, // initial x size CW_USEDEFAULT, // initial y size NULL, // parent window handle NULL, // window menu handle hInstance, // program instance handle NULL); // creation parameters ShowWindow(hwnd, iCmdShow); UpdateWindow(hwnd); while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { static HMENU hMenuMain, hMenuFile, hMenuEdit; HINSTANCE hInst; switch (message) { case WM_CREATE: hInst = ((LPCREATESTRUCT)lParam)->hInstance;//(HINSTANCE)GetWindowLong(hwnd,GWL_HINSTANCE); hMenuMain = LoadMenu(hInst, TEXT("MENUMAIN")); hMenuFile = LoadMenu(hInst, TEXT("MENUFILE")); hMenuEdit = LoadMenu(hInst, TEXT("MENUEDIT")); SetMenu(hwnd, hMenuMain); return 0; case WM_COMMAND: switch (LOWORD(wParam)) { case IDM_MAIN: SetMenu(hwnd, hMenuMain); return 0; case IDM_FILE: SetMenu(hwnd, hMenuFile); return 0; case IDM_EDIT: SetMenu(hwnd, hMenuEdit); return 0; case IDM_FILE_OPEN: case IDM_FILE_NEW: case IDM_FILE_SAVE: case IDM_FILE_SAVEAS: case IDM_EDIT_UNDO: case IDM_EDIT_COPY: case IDM_EDIT_CUT: case IDM_EDIT_DELETE: case IDM_EDIT_PASTE: MessageBeep(0); return 0; } break; case WM_DESTROY: SetMenu(hwnd, hMenuMain); DestroyMenu(hMenuFile); DestroyMenu(hMenuEdit); PostQuitMessage(0); return 0; } return DefWindowProc(hwnd, message, wParam, lParam); }
//resource.h
// Microsoft Visual C++ 生成的包含文件。 // 供 NoPopups.rc 使用 // #define IDM_MAIN 40001 #define IDM_FILE 40002 #define IDM_EDIT 40003 #define IDM_FILE_NEW 40004 #define IDM_FILE_OPEN 40005 #define IDM_FILE_SAVE 40006 #define IDM_FILE_SAVEAS 40007 #define IDM_EDIT_UNDO 40008 #define IDM_EDIT_CUT 40009 #define IDM_EDIT_COPY 40010 #define IDM_EDIT_PASTE 40011 #define IDM_EDIT_DELETE 40012 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 104 #define _APS_NEXT_COMMAND_VALUE 40030 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
//NoPopups.rc
// Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // 中文(简体,中国) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""winres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Menu // MENUMAIN MENU BEGIN MENUITEM "MAIN:", 0, INACTIVE MENUITEM "&File...", IDM_FILE MENUITEM "&Edit...", IDM_EDIT END MENUFILE MENU BEGIN MENUITEM "FILE:", 0, INACTIVE MENUITEM "&New", IDM_FILE_NEW MENUITEM "&Open...", IDM_FILE_OPEN MENUITEM "&Save", IDM_FILE_SAVE MENUITEM "Save &As", IDM_FILE_SAVEAS MENUITEM "(&Main)", IDM_MAIN END MENUEDIT MENU BEGIN MENUITEM "EDIT:", 0, INACTIVE MENUITEM "&Undo", IDM_EDIT_UNDO MENUITEM "Cu&t", IDM_EDIT_CUT MENUITEM "&Copy", IDM_EDIT_COPY MENUITEM "&Paste", IDM_EDIT_PASTE MENUITEM "De&lete", IDM_EDIT_DELETE MENUITEM "(&Main)", IDM_MAIN END #endif // 中文(简体,中国) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED
标签:
原文地址:http://www.cnblogs.com/5iedu/p/4668448.html