<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : User info. &#111;n menu items? Help!!</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : General Discussion : User info. &#111;n menu items? Help!!]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 14 May 2026 00:30:41 +0000</pubDate>
  <lastBuildDate>Wed, 20 Oct 2004 11:04:29 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=371</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[User info. &#111;n menu items? Help!! : Maybe you could look at the DynamicPopus...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=371&amp;PID=3583&amp;title=user-info-on-menu-items-help#3583</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 20 October 2004 at 11:04am<br /><br />Maybe you could look at the DynamicPopus sample.&nbsp; This might illustrate the functionality you are looking for.]]>
   </description>
   <pubDate>Wed, 20 Oct 2004 11:04:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=371&amp;PID=3583&amp;title=user-info-on-menu-items-help#3583</guid>
  </item> 
  <item>
   <title><![CDATA[User info. &#111;n menu items? Help!! : This is from MSDN: The WM_MENUCOMMAND...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=371&amp;PID=943&amp;title=user-info-on-menu-items-help#943</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=350">vladsch</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 04 February 2004 at 9:46pm<br /><br /><P>This is from MSDN:</P><P>The <B>WM_MENUCOMMAND</B> message is sent only for menus that are defined with the MNS_NOTIFYBYPOS flag set in the <B>dwStyle</B> member of the <B>MENUINFO</B> structure. </P><P>If you have that covered then add the following to your message map for the window:</P><P><table width="99%"><tr><td><pre class="BBcode">&nbsp;&nbsp;&nbsp; ON_MESSAGE(WM_MENUCOMMAND, OnMenuCommand)</pre></td></tr></table><BR></P><P>define in your window class header for the window:</P><P><table width="99%"><tr><td><pre class="BBcode">&nbsp;&nbsp;&nbsp; afx_msg long OnMenuCommand(WPARAM wParam, LPARAM lParam);</pre></td></tr></table><BR></P><P>And add the function (assuming CMainFrame is your window class name):</P><P><table width="99%"><tr><td><pre class="BBcode"></P><P>afx_msg long CMainFrame::OnMenuCommand(WPARAM wParam, LPARAM lParam)<BR>{<BR>&nbsp;&nbsp; HMENU hMenu = (HMENU)lParam;<BR>&nbsp;&nbsp; CMenu menu;<BR>&nbsp;&nbsp; MENUITEMINFO miInfo;</P><P>&nbsp;&nbsp; menu.Attach(hMenu);<BR>&nbsp;&nbsp; menu.GetMenuItemInfo(wParam, &amp;miInfo, TRUE);</P><P>&nbsp;&nbsp; // use the miInfo to&nbsp;extract the info&nbsp;you want and store relevant data &nbsp;in a member variable </P><P>&nbsp;&nbsp; //&nbsp;of your class,&nbsp; retrieve that variable value&nbsp;when trackpopupmenu call returns so you'll </P><P>&nbsp;&nbsp; // know which item was selected</P><P>&nbsp;&nbsp; . . .</P><P>&nbsp;&nbsp; menu.Detach();</P><P>&nbsp;&nbsp; return 0L;<BR>}<BR></pre></td></tr></table></P><P>I did not test this code because in my app I don't have any bypos menu items.</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Wed, 04 Feb 2004 21:46:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=371&amp;PID=943&amp;title=user-info-on-menu-items-help#943</guid>
  </item> 
  <item>
   <title><![CDATA[User info. &#111;n menu items? Help!! : I have an application that generates...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=371&amp;PID=823&amp;title=user-info-on-menu-items-help#823</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=323">cjsoft</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 20 January 2004 at 8:47am<br /><br /><P>I have an application that generates at runtime a rather large popup menu (on right click). The user action to perform (when selected) on every item is the same, just the information associated with each item is different. So rather than define a command id for every item (there are potentially&nbsp;thousands), I want to use the same command id for each item, but just set user info. to each menu item.</P><P>This I have achieved (I think) by using 'SetMenuItemInfo', but I can't find out how to retrieve this information once a menu item has been selected by the user - obviusly when the routed command hits my window, the menu has already been destroyed, and I'm not sure how to retrieve it anyway. The windows message 'WM_MENUCOMMAND' seems to indicate it might do what I want, but I can't work out how to integrate this into the my class.</P><P>This is driving me nuts!!! Any ideas anyone?</P><P>Thanks,</P><P>Colin</P><span style="font-size:10px"><br /><br />Edited by cjsoft</span>]]>
   </description>
   <pubDate>Tue, 20 Jan 2004 08:47:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=371&amp;PID=823&amp;title=user-info-on-menu-items-help#823</guid>
  </item> 
 </channel>
</rss>