C ++,弹出菜单滚动条

时间:2018-01-29 12:03:37

标签: c++ winapi

如何在此弹出菜单中添加垂直滚动条?已设置弹出窗口大小但未显示。

int FTPWindow::OnProfileChange() {
    if (!m_vProfiles)
        return -1;

    ::DestroyMenu(m_popupProfile);
    m_popupProfile = ::CreatePopupMenu();
    for(size_t i = 0; i < m_vProfiles->size(); i++) {
        ::AppendMenu(m_popupProfile, MF_STRING, IDM_POPUP_PROFILE_FIRST + i, m_vProfiles->at(i)->GetName());
    }
    MENUINFO mi = { sizeof(MENUINFO) };
    mi.fMask = MIM_MAXHEIGHT;
    mi.cyMax = 400;
    SetMenuInfo(m_popupProfile, &mi);
    POINT point = {100,100};
    HWND window;
    ClientToScreen(window, &point);
    TrackPopupMenu(m_popupProfile, TPM_RETURNCMD, 100, 100,0,window,NULL);
    m_toolbar.SetMenu(IDB_BUTTON_TOOLBAR_CONNECT, m_popupProfile);

    SetToolbarState();

    return 0;
}

0 个答案:

没有答案