<?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 : Child Dialogs in Task Panel</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Child Dialogs in Task Panel]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 21 Apr 2026 21:44:09 +0000</pubDate>
  <lastBuildDate>Wed, 14 Sep 2005 07:50:42 +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=1653</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[Child Dialogs in Task Panel : Hi! One of the possible solutions...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1653&amp;PID=8614&amp;title=child-dialogs-in-task-panel#8614</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1478">DenisZ</a><br /><strong>Subject:</strong> 1653<br /><strong>Posted:</strong> 14 September 2005 at 7:50am<br /><br /><P>Hi!</P><P>One of the possible solutions -&nbsp;overload OnCmdMsg() in your child dialog:</P><P><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>BOOL CTaskItemDlg::OnCmdMsg(UINT nID, <FONT color=#0000ff>int</FONT> nCode, <FONT color=#0000ff>void</FONT>* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)</FONT></P><P><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>{</FONT></P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT color=#008000><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>// First chance: standard command processing</FONT></FONT></P><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif"><FONT size=1><FONT color=#0000ff>if</FONT> ( CDialog::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo) )</FONT></FONT></P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif"><FONT size=1><FONT color=#0000ff>return</FONT> (TRUE);</FONT></FONT></P></BLOCKQUOTE><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT color=#008000><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>// Second chance: reroute processing to parent window</FONT></P></FONT><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>CWnd* pOwner = GetParent();</FONT></P><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif"><FONT size=1><FONT color=#0000ff>if</FONT> ( NULL != pOwner )</FONT></FONT></P><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>{</FONT></P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif"><FONT size=1><FONT color=#0000ff>if</FONT> ( pOwner-&gt;OnCmdMsg( nID, nCode, pExtra, pHandlerInfo ))</FONT></FONT></P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif"><FONT size=1><FONT color=#0000ff>return</FONT> (TRUE);</FONT></FONT></P></BLOCKQUOTE></BLOCKQUOTE><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>}</FONT></P><P><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1></FONT></P><P><FONT face="Verdana, Arial, Helvetica, sans-serif"><FONT size=1><FONT color=#0000ff>return</FONT> (FALSE);</FONT></FONT></P></BLOCKQUOTE><P><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>}</FONT></P><P><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>If you have more complicated scenario, like ICBM had you can set owner window of CTaskItemDlg to your top-level dialog and add third chance rerouting to OnCmdMsg:</FONT></P><P><FONT size=1>CWnd* pOwner = GetOwner();</FONT></P><P><FONT size=1>if ( NULL != pOwner )</FONT></P><P><FONT size=1>{</FONT></P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif"><FONT size=1><FONT color=#0000ff>if</FONT> ( pOwner-&gt;OnCmdMsg( nID, nCode, pExtra, pHandlerInfo ))</FONT></FONT></P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face="Verdana, Arial, Helvetica, sans-serif"><FONT size=1><FONT color=#0000ff>return</FONT> (TRUE);</FONT></FONT></P></BLOCKQUOTE></BLOCKQUOTE><P><FONT size=1>}</FONT></P><P><FONT size=1>These ensures that your top-level dialog/Task panel will receive at least button clicks. To handle complete range of messages you will probably need to overload OnWndMsg().</FONT></P><P>Best regards.</P>]]>
   </description>
   <pubDate>Wed, 14 Sep 2005 07:50:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1653&amp;PID=8614&amp;title=child-dialogs-in-task-panel#8614</guid>
  </item> 
  <item>
   <title><![CDATA[Child Dialogs in Task Panel : A bit more time thinking and I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1653&amp;PID=4720&amp;title=child-dialogs-in-task-panel#4720</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=886">AndyS</a><br /><strong>Subject:</strong> 1653<br /><strong>Posted:</strong> 13 January 2005 at 8:12am<br /><br /><P>A bit more time thinking and I decided it was laziness on my part trying to avoid writing specific classes for each of the TaskPanel Dialogs. In the end the classes are tiny anyway, it's a whole lot more managable and easier in the long run. Also has the advantage of being able to derive task panel dialogs&nbsp;from the resize dialogs so the task panel dialogs can be made to correctly resize (as they do in windows explorer search dialogs). Perhaps that should be in the Task Pane sample.</P><P>ICBM - I ended up doing almost the same to get the message up to the parent but with only a single GetParent() as I handle the messages in the task panel control rather than in it's parent dialog. </P><P>I also noticed the tab thing which is an annoyance. It only tabs around the controls within the panel dialog. That's either an oversight or a bug since regular custom controls will happily tab through as required.</P>]]>
   </description>
   <pubDate>Thu, 13 Jan 2005 08:12:10 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1653&amp;PID=4720&amp;title=child-dialogs-in-task-panel#4720</guid>
  </item> 
  <item>
   <title><![CDATA[Child Dialogs in Task Panel : I had the same problem. I wanted...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1653&amp;PID=4695&amp;title=child-dialogs-in-task-panel#4695</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=312">ICBM</a><br /><strong>Subject:</strong> 1653<br /><strong>Posted:</strong> 11 January 2005 at 3:27pm<br /><br /><P><FONT size=2>I had the same problem. I wanted to have the parent window handle a particular button press, but could not get it to go. I ended up with this utterly hideous hack:</FONT></P><FONT color=#0000ff><P><FONT size=1>void</FONT></FONT><FONT size=1> CNameTPDlg::OnBtnSearchClicked()<BR>{<BR><FONT color=#0000ff>static</FONT> <FONT color=#0000ff>const</FONT> UINT FJ_SEARCH_BTN_CLICKED = ::RegisterWindowMessage(_T"FJ_SEARCH_BTN_CLICKED"));<BR></FONT><FONT color=#c0c0c0><BR><FONT size=1>// Ugly !<BR></FONT></FONT><FONT size=1> GetParent()-&gt;GetParent()-&gt;SendMessage(FJ_SEARCH_BTN_CL ICKED);<BR>}</FONT></P><P><FONT size=2>The secondary problem, which I have not attempted to solve, is that the TAB key will only tab around the dialog box controls. You must physically click outside the area of the dialog box to send the focus elsewhere in the application. The sample app that codejock supplies (their search app) has exactly the same problem.</FONT></P><P><FONT size=1>&nbsp;</P></FONT>]]>
   </description>
   <pubDate>Tue, 11 Jan 2005 15:27:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1653&amp;PID=4695&amp;title=child-dialogs-in-task-panel#4695</guid>
  </item> 
  <item>
   <title><![CDATA[Child Dialogs in Task Panel : The &amp;#034;Task Panel&amp;#034; sample...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1653&amp;PID=4679&amp;title=child-dialogs-in-task-panel#4679</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=886">AndyS</a><br /><strong>Subject:</strong> 1653<br /><strong>Posted:</strong> 11 January 2005 at 4:26am<br /><br /><P>The "Task Panel" sample illustrates how to use a child dialog as the content of a task panel group. That's great and I have that working just fine using the example TaskPanelDlg class to handle colouring as in the example. I can see how you might roll your own TaskPanelDlg classes to wrap up processing of the child dialog's controls and then notify the parent when required. However, I only want to use the child dialogs so I can lay out the controls how I need them in resource editor&nbsp;and this particular task panel is simple enough to handle all control messages itself. So the question is... how do I go about getting the task panel window to handle messages from child dialogs created as controls.</P><P>The obvious comment is (as suggested in MFC help) that the child window commands (e.g. ON_BN_CLICKED) are passed to the parent in the absence of a handler but this does not seem to be the case. </P><P>Thanks</P>]]>
   </description>
   <pubDate>Tue, 11 Jan 2005 04:26:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1653&amp;PID=4679&amp;title=child-dialogs-in-task-panel#4679</guid>
  </item> 
 </channel>
</rss>