title: How do I put a checkmark on a menu item that has submenu items. (Visual studio 2008 C++/MFC)
body: <p>I have a menu that contains submenus.</p>
  
  <p>eg:</p>
  
  <ul>
  <li>Item1</li>
  <li>Item2</li>
  <li>Item3
  
  <ul>
  <li>item A</li>
  <li>Item B</li>
  </ul></li>
  </ul>
  
  <p>Item3 has items under it.</p>
  
  <p>At any given time 1, 2, or the items under 3 should be checked.  Since I don't have an ID for Item3 I have to use the <code>MF_BYPOSITION</code> indicator when I try to set a check on Item3 to indicate one of its children has a checkmark.  Item3 should have a checkmark if A or B are checked.  I am able to check items 1 and 2 and A and B - but can't figure out item3.</p>
  
  <p>I have not been able to successfully use either <code>::CheckMenuItem()</code> or <code>ModifyMenu()</code> to set the check mark.  </p>
  
  <p>Can someone point me to an example that does this successfully?  The docs seem to indicate it can be done, but I have been unable to do it.</p>
  
  <p>EDIT</p>
  
  <p>This is for a menu that is set as the menu for a dlg box.  The menu bar has three items - one of which drops down to what is shown above.  </p>
  
  <p>Note also, it is used as a popup for a right click, but I will take any suggestions to work in either case.</p>