<DIV><FONT face=arial size=3>Hi,</FONT></DIV>
<DIV><FONT face=arial size=3></FONT>&nbsp;</DIV>
<DIV><FONT face=arial><FONT size=3>I tried what to advice me, and now, no problem anymore concerning <SPAN style="FONT-SIZE: 12pt">clicking in my render window. I am so happy, thanks a lot.&nbsp;</SPAN></FONT></FONT></DIV>
<DIV><SPAN style="FONT-SIZE: 12pt"></SPAN><FONT face=arial size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=arial size=3><STRONG>CWnd* pWnd = GetDlgItem(IDC_RECT);<BR></STRONG></FONT><FONT face=arial><FONT size=3><FONT color=#000000><STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">myRenderWindow -&gt;</SPAN>SetParentId(this-&gt;m_hWnd);<BR><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">myRenderWindow -&gt;</SPAN>SetWindowId(pWnd-&gt;GetSafeHwnd());<BR><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">myRenderWindow -&gt;</SPAN>WindowInitialize();<BR>&nbsp;pWnd-&gt;ShowWindow(SW_SHOW);</STRONG></FONT></FONT></FONT></DIV>
<DIV><FONT face=arial size=3></FONT>&nbsp;</DIV>
<DIV><FONT face=arial><SPAN style="FONT-SIZE: 12pt">- However, there is still something&nbsp;annoying: </SPAN></FONT></DIV>
<DIV><FONT face=arial><SPAN style="FONT-SIZE: 12pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; now that my renderwindow is associated with the MFC window (CWnd* pWnd), the only way to make it appear, is to set the MFC window <STRONG>visible</STRONG> (ShowWindow(SW_SHOW)). But, by doing this, the MFC window itself is also visible and every paint called, I have to click on the render window that I can't see to make it appear. So strange! what I would like to have is <STRONG>a render window visible but not the rectangle that contains it. </STRONG></SPAN></FONT></DIV>
<DIV><FONT face=arial size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=arial><SPAN style="FONT-SIZE: 12pt">Any idea?!</SPAN></FONT></DIV>
<DIV><FONT face=arial size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=arial><SPAN style="FONT-SIZE: 12pt">Isabelle</SPAN></FONT></DIV>
<DIV><BR><BR><B><I>John Platt &lt;jcplatt@lineone.net&gt;</I></B> a écrit :</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="Microsoft Word 10 (filtered)" name=Generator>
<STYLE>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {margin-right:0cm;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle19
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</STYLE>

<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi Isabelle,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I haven’t used CFormView but I assume you have defined a control on your dialog template (IDC_RECT?) in which to draw the vtk images. I would have thought that the vtk render window wants the handle to this control rather than the CFormView derived class, something like</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">CWnd* pWnd = GetDlgItem(IDC_RECT);</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">HWND hWnd = pWnd-&gt;GetSafeHwnd();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">myRenderWindow -&gt;SetParentId( hWnd );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Only a guess.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">John.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> vtkusers-bounces+jcplatt=lineone.net@vtk.org [mailto:vtkusers-bounces+jcplatt=lineone.net@vtk.org] <B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Renaud Isabelle<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> </SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">23 August 2005</SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> </SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">19:05</SPAN></FONT><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> insight-users@itk.org; vtkusers@public.kitware.com<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [vtkusers] help with
 renderwindow just a part of MFC window</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Hi, </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">I got some problems with&nbsp;handling interaction between MFC interface and vtkRenderWindow.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">The main problem that I have, lies in the fact that <STRONG><B><FONT face="Times New Roman">my render window is just a small part of my MFC&nbsp;window (CView</FONT></B></STRONG>). Indeed, when left button mouse is pressed in the MFC window, my function renderWindow-&gt;SelectPoint() is called&nbsp;only when clicked point is not in the render window. I checked out if my interactor size was set to correct dimensions and it is actually the case. But I can't figure out why my function is called only when I clicked outside the render window. </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- Maybe the origin of the problem is that I am missing something with&nbsp;<STRONG><B><FONT face="Times New Roman">SetParentId</FONT></B></STRONG>, <STRONG><B><FONT face="Times New Roman">SetWindowId</FONT></B></STRONG> and so on... </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Most of the&nbsp;examples that I read deal with a vtkRenderWindow's size the same than CView's size: in this case, <STRONG><B><FONT face="Times New Roman">myRenderWindow-&gt;SetParentId(this-&gt;h_Wnd)</FONT></B></STRONG> seems to fit exactly. </SPAN></FONT></P></DIV>
<DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Here is what I did: </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<STRONG><B><FONT face="Times New Roman">// setup the parent window</FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman">&nbsp;myRenderWindow-&gt;SetParentId(this-&gt;m_hWnd);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">&nbsp;myRenderWindow-&gt;WindowInitialize();</FONT></B></STRONG></SPAN></B></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;CRect rect;</SPAN></FONT></B></STRONG><B><SPAN style="FONT-WEIGHT: bold"><BR><STRONG><B><FONT face="Times New Roman">&nbsp;GetDlgItem(IDC_RECT)-&gt;GetWindowRect(rect);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">myRenderWindow-&gt;SetPosition(rect.left,rect.top);</FONT></B></STRONG><BR><STRONG><B><FONT face="Times New Roman">myRenderWindow-&gt;SetSize(rect.Width(),rect.Height());</FONT></B></STRONG></SPAN></B></P></DIV></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- Now, I saw an example where: </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">HWND hWndRenderer = ::CreateWindowEx(WS_EX_CLIENTEDGE, OCT3DRENDERCLASS, NULL,&nbsp;WS_CHILD|WS_VISIBLE|WS_TABSTOP, 7, 7, nWidth, nHeight,&nbsp;m_hWnd, NULL, AfxGetInstanceHandle(), NULL);</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT></B></STRONG>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;myRenderWindow-&gt;SetParentId(hWndRenderer);</SPAN></FONT></B></STRONG></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Does someone try this kind of thing? Do you think this could be the solution? Or maybe someone has <STRONG><B><FONT face="Times New Roman">examples where, like me, the render window is just a part of a MFC window</FONT></B></STRONG>.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- Or, maybe, my problem comes from somewhere else: timer,&nbsp;interactor-&gt;Start()... because after a while everything works fine.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">I hope someone can help me.....</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Isabelle</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR align=center width="100%" SIZE=1>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><B><FONT face="Times New Roman" color=red size=3><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: red">Appel audio GRATUIT</SPAN></FONT> partout dans le monde</B> avec le nouveau Yahoo! Messenger<BR><A href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http:/fr.messenger.yahoo.com">Téléchargez le ici !</A> </P></DIV></BLOCKQUOTE><p>
                <hr size=1> 
<b><font color=#FF0000>Appel audio GRATUIT</font> partout dans le monde</b> avec le nouveau Yahoo! Messenger<br> 
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com">Téléchargez le ici !</a>