none
菜单怎样创建,怎样加载?怎样消息相应? RRS feed

答案

  • 在资源里添加一Menu,然后在对话框的OnInitDialog里添加:
    SHMENUBARINFO mbi;
    memset(&mbi, 0, sizeof(SHMENUBARINFO));
    mbi.cbSize = sizeof(SHMENUBARINFO);
    mbi.dwFlags = SHCMBF_HMENU;
    mbi.hwndParent = m_hWnd;
    mbi.nToolBarId = IDR_MENU_TEST;
    mbi.hInstRes = ::AfxGetInstanceHandle();
    SHCreateMenuBar(&mbi);

     

    2007年8月9日 6:06