none
windows programming menu resource insert problem! RRS feed

  • 问题

  • 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以前版本))
    2011年3月19日 13:15

答案

  • 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.

    2011年3月22日 9:40
    版主

全部回复

  • Can you describe your problem cleary? Sorry, I don't know what your mean.
    Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.
    2011年3月22日 7:38
    版主
  • 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.

    2011年3月22日 9:40
    版主
  • 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.

    2011年3月25日 9:35
    版主