smartphone创建菜单时出错

来源:互联网 发布:chrome js获取shift键 编辑:程序博客网 时间:2024/06/14 14:20

 // Set up the menu bar
 SHMENUBARINFO shmbi;
 ZeroMemory(&shmbi, sizeof(shmbi));
    shmbi.cbSize = sizeof(shmbi);
    shmbi.hwndParent = hDlg;
    shmbi.nToolBarId = IDR_MENUBAR1;
    shmbi.hInstRes = ghInstance;

 // If we could not initialize the dialog box, return an error
 if(!(SHCreateMenuBar(&shmbi)) //此处SHCreateMenuBar(&mbi)=0,直接return 了!!
 {
    return FALSE;
 }

这一句是关键
mbi.dwFlags|= SHCMBF_HMENU加上这句即可

原创粉丝点击