<?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 : menu add dynamically and mouse hooking</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : menu add dynamically and mouse hooking]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 17 May 2026 07:45:56 +0000</pubDate>
  <lastBuildDate>Tue, 06 Oct 2009 21:40:46 +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=15307</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[menu add dynamically and mouse hooking : Hello everybody!  First, I&amp;#039;d...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15307&amp;PID=53656&amp;title=menu-add-dynamically-and-mouse-hooking#53656</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5572">suchout</a><br /><strong>Subject:</strong> 15307<br /><strong>Posted:</strong> 06 October 2009 at 9:40pm<br /><br /><P>Hello everybody!</P><DIV><P>First, I'd like to beg your pardon that I'm quite poor in English.</P><DIV>&nbsp;</DIV><DIV>I developed a MDI application which &nbsp;make new User-Interface by call DLL.</DIV></DIV><DIV>&nbsp;</DIV><DIV>First, I&nbsp;called DLL with MainFrame's variable pCommandBars&nbsp;as an argument</DIV><DIV>---OK---</DIV><DIV>and .. in Dll , i initialized MenuBar and Toolbar&nbsp;&nbsp;so simple&nbsp;</DIV><DIV>---OK---</DIV><DIV>and .. UI Construction Button Clicked -&gt; MenuBar , ToolBar Controls Clean up.</DIV><DIV><FONT color=#ff0000>Question 1. How&nbsp;to Delete Menu Bar, ToolBar!</FONT></DIV><DIV>i try this.</DIV><DIV>--------------------------------------------------------------------------------------------------</DIV><DIV>nCount = pCommandBars-&gt;GetCount();<BR>&nbsp;<BR>&nbsp;for (int j = 1; j &lt; nCount; j++) {<BR>&nbsp;&nbsp;&nbsp; m_pToolBar = pCommandBars-&gt;GetAt(j);<BR>&nbsp;&nbsp;&nbsp; nCount2 = m_pToolBar-&gt;GetControlCount();</DIV><DIV>&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; nCount2; i++) {&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pToolBar-&gt;GetControls()-&gt;Remove(0);<BR>&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;<BR>&nbsp;}</DIV><DIV>&nbsp;--------------------------------------------------------------------------------------------------</DIV><DIV>but this way Not Deleted Toolbar all&nbsp; but&nbsp; deleted all of Toolbar's item</DIV><DIV>&nbsp;</DIV><DIV>i want to delete ToolBar (Commandbar) All </DIV><DIV>&nbsp;</DIV><DIV><FONT color=#ff0000>and make some of User want count of Toolbar</FONT></DIV><DIV>&nbsp;</DIV><DIV>but!!!!!!!</DIV><DIV>BuT!!!!!</DIV><DIV>In dll project , can not use this!</DIV><DIV>--------------------------------------------------------------------------------------------------</DIV><DIV>for (i = 1; i &lt; pMainCommandBars-&gt;GetCount();i++) {&nbsp;&nbsp;//i == 0 -&gt; menubar,<BR>&nbsp;&nbsp;m_pToolBar = pMainCommandBars-&gt;GetAt(i);&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;pMainCommandBars-&gt;Remove(pMainCommandBars-&gt;GetAt(i));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // M== Error!!</DIV><DIV>}</DIV><DIV><DIV>--------------------------------------------------------------------------------------------------</DIV></DIV><DIV>and .. i use XML Document &nbsp; for get&nbsp;controls&nbsp;property (ex. Menu(item) - name , ID,&nbsp;&nbsp; &nbsp;Toolbar(button) - &nbsp;icon ID, ....)&nbsp; </DIV><DIV>---OK---</DIV><DIV><FONT color=#ff0000>and .. re-construct MenuBar, ToolBar </FONT></DIV><DIV><DIV>but!!!!!!!</DIV><DIV>BuT!!!!!</DIV><DIV>In dll project , can not use this!</DIV><DIV>--------------------------------------------------------------------------------------------------</DIV><DIV>CXTPToolBar* pToolBar = (CXTPToolBar*)pCommandBars-&gt;Add(_T("Standard"), xtpBarTop);&nbsp;&nbsp; //&nbsp;&lt;== make error<BR>&nbsp;if (!pToolBar || !pToolBar-&gt;LoadToolBar(IDR_MAINFRAME))<BR>&nbsp;{<BR>&nbsp;&nbsp; &nbsp;&nbsp;TRACE0("Failed to create toolbar\n");<BR>&nbsp;&nbsp; &nbsp;&nbsp;return -1;<BR>&nbsp;}</DIV><DIV>--------------------------------------------------------------------------------------------------&nbsp;</DIV></DIV><DIV>&nbsp;</DIV><DIV>and .. skip error(using '/* , */' ^^;;;;) , &nbsp;i construct menu.</DIV><DIV>--------------------------------------------------------------------------------------------------&nbsp;</DIV><DIV>m_Menu.CreateMenu();</DIV><DIV>..initmenu()...</DIV><DIV>m_pMenuBar-&gt;GetControls()-&gt;LoadMenuW(&amp;m_Menu);</DIV><DIV><DIV>--------------------------------------------------------------------------------------------------&nbsp;</DIV><DIV>&nbsp;</DIV></DIV><DIV>but.!</DIV><DIV>BUT!!!</DIV><DIV>Execute Program!, i put mouse curser on the menu item&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>Boom~~~</DIV><DIV>&nbsp;</DIV><DIV>so i think that why? but...i don't know that....&#12640;&#12640;</DIV><DIV>&nbsp;</DIV><DIV>please help me</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 06 Oct 2009 21:40:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15307&amp;PID=53656&amp;title=menu-add-dynamically-and-mouse-hooking#53656</guid>
  </item> 
 </channel>
</rss>