积极答复者
windows programming menu resource insert problem!

问题
-
I insert a menu resource !but it doesnt work! I send the menu "quit" message to WM_CLOSE. but when I click it ,nothing happend,
before I insert the menu "quit", the message WM_CLOSE works, I dont know why!
- 已移动 duoduobear 2011年3月21日 8:40 非硬件和驱动程序开发问题 (发件人:Windows硬件开发者论坛(包含WHQL测试))
- 已移动 Vicky SongMicrosoft employee 2011年3月22日 6:12 (发件人:Visual Studio 相关讨论(Visual Studio 2010以前版本))
答案
-
Hi fantasy,
Assume your project is a MFC project.
We can perform the following steps to add a new menu to close application:
1. insert menu ;
2. add a menu item named “quit”;
3. specified this menu item’s ID = ID_APP_EXIT
ID_APP_EXIT Exit the application.
CWinApp::OnAppExit handles this command by sending a WM_CLOSE message to the application's main window. The standard shutting down of the application (prompting for dirty files and so on) is handled by the CFrameWnd implementation.
More information : http://msdn.microsoft.com/en-us/library/11861byt.aspx ;
In addition , this is MSDN Chinese forum . please ask issue in Chinese . Or post it in http://social.msdn.microsoft.com/Forums/en-US/category/visualc
If I have misunderstood anything , please let me know.
Best regards,
Lucy
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 lucy-liuModerator 2011年3月25日 9:34
全部回复
-
Hi fantasy,
Assume your project is a MFC project.
We can perform the following steps to add a new menu to close application:
1. insert menu ;
2. add a menu item named “quit”;
3. specified this menu item’s ID = ID_APP_EXIT
ID_APP_EXIT Exit the application.
CWinApp::OnAppExit handles this command by sending a WM_CLOSE message to the application's main window. The standard shutting down of the application (prompting for dirty files and so on) is handled by the CFrameWnd implementation.
More information : http://msdn.microsoft.com/en-us/library/11861byt.aspx ;
In addition , this is MSDN Chinese forum . please ask issue in Chinese . Or post it in http://social.msdn.microsoft.com/Forums/en-US/category/visualc
If I have misunderstood anything , please let me know.
Best regards,
Lucy
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 lucy-liuModerator 2011年3月25日 9:34
-
Hi fantasy,
我先暂时把我最后的回答标记为答案,如果您认为没有解决您的问题,您可以取消标记为答案!
谢谢您的理解!
Lucy
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.