1.在SDK中,改变菜单,等UI对象的属性是利用其句柄,在调用相应的API进行控制,
而我在学习VC中发现控制UI属性是这样的,先利用GetParent()取得指向窗口对象的指针,例CWnd *pParent=GetParent();
  CMenu *pMenu=pParent->GetMenu();
  CMenu *SubMenu1=pMenu->GetSubMenu(0);
  SubMenu1->CheckMenuItem(ID_LXC,MF_CHECKED);
令我感到疑惑的是pMenu是指向UI对象,还是CMenu类对象啊.请高手指点,万分感激。

解决方案 »

  1.   

    应该是指向CMenu类对象吧:GetSubMenu
    The GetSubMenu function retrieves a handle to the drop-down menu or submenu activated by the specified menu item. HMENU GetSubMenu(
      HMENU hMenu,  // handle to menu
      int nPos      // menu item position
    );
    Parameters
    hMenu 
    [in] Handle to the menu. 
    nPos 
    [in] Specifies the zero-based relative position in the specified menu of an item that activates a drop-down menu or submenu. 
      

  2.   

    pMenu是指向CMenu类对象
    从:CMenu *pMenu=pParent->GetMenu();可以看出来!