miiEncoding.hSubMenu = reinterpret_cast< HMENU > (varEncSubMenu.byref); menu.SetMenuItemInfo(0, &miiEncoding, TRUE);//丢掉设计时占位用的菜单,替换为“编码”菜单 } } } } pPopup = menu.GetSubMenu( 0 ); break; } ...... } if ( pPopup != 0 ) { CRect rc; ::SendMessage( pNMToolBar->hdr.hwndFrom, TB_GETRECT, pNMToolBar->iItem, ( LPARAM )&rc ); rc.top = rc.bottom; ::ClientToScreen( pNMToolBar->hdr.hwndFrom, &rc.TopLeft() ); long lResult = pPopup->TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RETURNCMD, rc.left, rc.top, this ); m_bIsEncodMenuPopup = false; if ( pNMToolBar->iItem == ID_VIEW_ENCODE ) { //其余的事交给浏览器去做,参考《Internet Explorer 编程简述(五)调用IE隐藏的命令(中文版)》 |