[vtkusers] a question about the SDI example

455535440 455535440 at qq.com
Sat Jun 4 10:26:50 EDT 2011


hello everybody~~
i found a chm file in Examples\GUI\Win32\vtkMFC which has a example about creating a SDI programe with VTK.
In this file I see the autor add the windows virtual function WindowProc() like below:

LRESULT CVtkSDIView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 

{
  switch (message)
  {
    //case WM_PAINT: 
    case WM_LBUTTONDOWN: 
    case WM_LBUTTONUP: 
    case WM_MBUTTONDOWN: 
    case WM_MBUTTONUP: 
    case WM_RBUTTONDOWN: 
    case WM_RBUTTONUP: 
    case WM_MOUSEMOVE:
    case WM_CHAR:
    case WM_TIMER:
    if (this->iren->GetInitialized())
    {
        return vtkHandleMessage2(this->m_hWnd, message, wParam, lParam, this->iren);
    }
    break;
  }
  return CView::WindowProc(message, wParam, lParam);
}

as the autor say he use vtkHandleMessage2 pass the message to the vtkWin32RenderWindowInteractor.
However , i made a test  ;  i delete the switch  which means i didn't use the vtkHandleMessage2 and the message will send to CView directly ;  then I run the programe 
when the renWin->render works   the vtkWin32RenderWindowInteractor still work;
what I delete did nothing to the programe.
So i don't know why the vtkWin32RenderWindowInteractor still work, if I want to make some message like
WM_LBUTTONDOWN not get by vtkWin32RenderWindowInteractor , How can I do?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110604/3d8612e4/attachment.htm>


More information about the vtkusers mailing list