// 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加上这句即可