<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<meta name=Generator content="Microsoft Word 10 (filtered)">

<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>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Isabelle,</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Have you tried letting VTK create it&#8217;s
own window in your control &#8211; something like &#8211;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>CWnd* pWnd
= GetDlgItem(IDC_RECT);</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>HWND hWnd
= pWnd-&gt;GetSafeHwnd();</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>myRenderWindow-&gt;SetParentId(
hWnd );</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'> //
Change the size of the VTK window to match the client area.</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'> CRect rect;</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'> pWnd-&gt;GetClientRect(
&amp;rect );</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'> myInteractor-&gt;UpdateSize(
rect.right-rect.left, rect.bottom-rect.top );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>and use it&#8217;s own WndProc() instead
of your override? (you must remove myInteractor-&gt;SetInstallMessageProc(false)).</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>John.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;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> 26 August 2005 15:42<br>
<b><span style='font-weight:bold'>To:</span></b> John Platt<br>
<b><span style='font-weight:bold'>Cc:</span></b> vtkusers@vtk.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [vtkusers] help</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Hi,</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>I am still locked with
problems of handling interaction between MFC interface and vtkRenderWindow. </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>The main
problem is that <strong><b><font face=Arial><span style='font-family:Arial'>my
render window is just a small part of my MFC&nbsp;window (CView</span></font></b></strong>).
</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>To resume, I tried 2
possibilities:</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>-1- </span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><b><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial;font-weight:bold'>&nbsp;myRenderWindow-&gt;SetParentId(this-&gt;m_hWnd);<br>
&nbsp;myRenderWindow-&gt;WindowInitialize();</span></font></b></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;<strong><b><font face=Arial><span
style='font-family:Arial'>CRect rect;</span></font></b></strong></span></font><b><span
style='font-weight:bold'><br>
</span></b><b><font face=Arial><span style='font-family:Arial;font-weight:bold'>&nbsp;GetDlgItem(IDC_RECT)-&gt;GetWindowRect(rect);<br>
&nbsp; myRenderWindow-&gt;SetPosition(rect.left,rect.top);<br>
&nbsp; myRenderWindow-&gt;SetSize(rect.Width(),rect.Height());</span></font></b></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2
face="Times New Roman"><span style='font-size:10.0pt'>But in this case, clicks
in the MFC window&nbsp;are fine but clicks in the render window are not always
correctly handled. </span></font>I couldn't figure out why mouse&nbsp;clicks
are only handled when&nbsp; happening&nbsp;outside the render window. </p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>-2- </span></font></p>

</div>

<div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><strong><b><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>CWnd* pWnd =
GetDlgItem(IDC_RECT);</span></font></b></strong><b><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial;font-weight:bold'><br>
<strong><b><font color=black face=Arial><span style='font-family:Arial;
color:black'>myRenderWindow -&gt;</span></font></b></strong><strong><b><font
face=Arial><span style='font-family:Arial'>SetParentId(this-&gt;m_hWnd);</span></font></b></strong><br>
<strong><b><font color=navy face=Arial><span style='font-family:Arial;
color:navy'>myRenderWindow -&gt;</span></font></b></strong><strong><b><font
color=black face=Arial><span style='font-family:Arial;color:black'>SetWindowId(pWnd-&gt;GetSafeHwnd());</span></font></b></strong><font
color=black><span style='color:black'><br>
</span></font><strong><b><font color=navy face=Arial><span style='font-family:
Arial;color:navy'>myRenderWindow -&gt;</span></font></b></strong><strong><b><font
color=black face=Arial><span style='font-family:Arial;color:black'>WindowInitialize();</span></font></b></strong><font
color=black><span style='color:black'><br>
<strong><b><font face=Arial><span style='font-family:Arial'>&nbsp;pWnd-&gt;ShowWindow(SW_SHOW);</span></font></b></strong></span></font></span></font></b></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>This seems better but now, I got
problems while repainting that I didn't have with the&nbsp;1st solution: my
render window appears only when the CWnd associated to it, is visible with </span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>ShowWindow(SW_SHOW)). But, by doing
this, the MFC window itself is also visible and every paint called, <strong><b><font
face=Arial><span style='font-family:Arial'>I have to click on the render window
that I can't see to make it appear</span></font></b></strong>. So strange! what
I would like to have is <strong><b><font face=Arial><span style='font-family:
Arial'>a render window visible but not the rectangle that contains it. </span></font></b></strong></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>- So, none of these solutions works
fine.&nbsp; I don't know <strong><b><font face=Arial><span style='font-family:
Arial'>what else to try</span></font></b></strong>. I checked out in the code
and it seems that, to handle my paint problem, maybe, I could set the <strong><b><font
face=Arial><span style='font-family:Arial'>Device context</span></font></b></strong>
to the same than my parent's with <strong><b><font face=Arial><span
style='font-family:Arial'>SetDisplayId</span></font></b></strong>. But I
couldn't find examples that implement SetDisplayId(). <strong><b><font
face=Arial><span style='font-family:Arial'>What is the use of this function?
Could it be the solution to my problem. </span></font></b></strong></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Isabelle</span></font></p>

</div>

</div>

<div class=MsoNormal align=center style='margin-left:36.0pt;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=1 width="100%" align=center>

</span></font></div>

<p class=MsoNormal style='margin-left:36.0pt'><b><font size=3 color=red
face="Times New Roman"><span style='font-size:12.0pt;color:red;font-weight:
bold'>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>

</body>

</html>