[VC][轉貼]如何在Dialog base的程式加上menu
發表於 : 2008年 11月 27日, 16:53
請參閱:http://www.vchelp.net/itbookreview/view ... aper_id=41
在 dialog 的 OnInitDialog 內添加以下程式碼:
在 dialog 的 OnInitDialog 內添加以下程式碼:
代碼: 選擇全部
// menu add
CMenu myMenu;
myMenu.LoadMenu(IDR_MENU1);
SetMenu(&myMenu);
CString a;
//get menu caption by position
myMenu.GetMenuString(0, a, MF_BYPOSITION);
MessageBox(a);
//modify menu caption by position
myMenu.ModifyMenu(0, MF_BYPOSITION, 0, "haha");