<?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 : Enabling Menu Items without code handlers</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Enabling Menu Items without code handlers]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 07:15:13 +0000</pubDate>
  <lastBuildDate>Fri, 20 Jun 2008 06:41:30 +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=11086</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[Enabling Menu Items without code handlers : hi all,I&amp;#039;ve managed to solve...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11086&amp;PID=37086&amp;title=enabling-menu-items-without-code-handlers#37086</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3688">BobWansink</a><br /><strong>Subject:</strong> 11086<br /><strong>Posted:</strong> 20 June 2008 at 6:41am<br /><br />hi all,<br><br>I've managed to solve it with a combination of ON_COMMAND_RANGE and some of our own functions. The menu items are now selectable and transmit their message correctly.<br><br>Thanks for the help!<br>]]>
   </description>
   <pubDate>Fri, 20 Jun 2008 06:41:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11086&amp;PID=37086&amp;title=enabling-menu-items-without-code-handlers#37086</guid>
  </item> 
  <item>
   <title><![CDATA[Enabling Menu Items without code handlers : I&amp;#039;m not sure if this is similar...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11086&amp;PID=36939&amp;title=enabling-menu-items-without-code-handlers#36939</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3717">Smucker</a><br /><strong>Subject:</strong> 11086<br /><strong>Posted:</strong> 18 June 2008 at 1:51pm<br /><br />I'm not sure if this is similar enough to your situation to be of use, but here's an idea.<br><br>I had my own table-based command enabler/grayer/checker code which Ididn't want to replace with a separate method for each of hundreds of commands.<br><br>I created a message map entry as follows:<br><br>&nbsp;&nbsp;&nbsp; <b><font face="Courier New, Courier, mono">ON_UPDATE_COMMAND_UI_RANGE(CMD_FIRST, CMD_LAST, UpdateCmdUI)</font></b><br><br>UpdateCmdUI is defined as follows:<br><br><b><font face="Courier New, Courier, mono">void CMainFrame::UpdateCmdUI(CCmdUI* pcmdui)<br>{<br>#define LAG_CMDUI 200<br>&nbsp;&nbsp;&nbsp; static DWORD curtime = 0,lasttime = 0;<br><br>&nbsp;&nbsp;&nbsp; if ( (curtime = ::GetTickCount()) &gt; lasttime + LAG_CMDUI) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ::UpdateCommandStates(cmd_table, NULL, NULL);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lasttime = ::GetTickCount();<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; for (int i=0; ::cmd_table&#091;i&#093;.id != 0; i++) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (pcmdui-&gt;m_nID == (UINT)::cmd_table&#091;i&#093;.id) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pcmdui-&gt;SetCheck((BOOL)::cmd_table&#091;i&#093;.state &amp; MF_CHECKED);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pcmdui-&gt;Enable(!(::cmd_table&#091;i&#093;.state &amp; (MF_DISABLED|MF_GRAYED)));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}</font></b><br><br><b>UpdateCommandStates </b>processes all commands and sets the flags appropritely in cmd_table. The 200 ms lag time keeps it from running repeatedly.<br><br>Of course, if you just always want them enabled, you could just call <b><font face="Courier New, Courier, mono">pcmdui-&gt;Enable</font></b>.<br><b><br></b>]]>
   </description>
   <pubDate>Wed, 18 Jun 2008 13:51:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11086&amp;PID=36939&amp;title=enabling-menu-items-without-code-handlers#36939</guid>
  </item> 
  <item>
   <title><![CDATA[Enabling Menu Items without code handlers : Hi,  So you don&amp;#039;t know...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11086&amp;PID=36918&amp;title=enabling-menu-items-without-code-handlers#36918</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11086<br /><strong>Posted:</strong> 18 June 2008 at 7:06am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>So you don't know what Ids will CMenu have ? How you want to catch Click event in this case ?</DIV>]]>
   </description>
   <pubDate>Wed, 18 Jun 2008 07:06:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11086&amp;PID=36918&amp;title=enabling-menu-items-without-code-handlers#36918</guid>
  </item> 
  <item>
   <title><![CDATA[Enabling Menu Items without code handlers : Hi!I&amp;#039;ve added a CXTPMenuBar...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11086&amp;PID=36909&amp;title=enabling-menu-items-without-code-handlers#36909</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3688">BobWansink</a><br /><strong>Subject:</strong> 11086<br /><strong>Posted:</strong> 18 June 2008 at 5:12am<br /><br />Hi!<br><br>I've added a CXTPMenuBar to a CWnd derived panel. I've stumbled onto another problem, and I hope you know the answer to this.<br><br>The menu isn't loaded with a reference, but with a CMenu. The CMenu is generated automatically in our software. The menuitems are greyed at the moment, since there isn't a handler for their id's. How can I activate these menu's?<br><br>Thanks!<br><br>Bob<br>]]>
   </description>
   <pubDate>Wed, 18 Jun 2008 05:12:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11086&amp;PID=36909&amp;title=enabling-menu-items-without-code-handlers#36909</guid>
  </item> 
 </channel>
</rss>