Home » U++ Library support » U++ Widgets - General questions or Mixed problems » how is the WindowProc of DHCtrl working?
how is the WindowProc of DHCtrl working? [message #9034] |
Sat, 14 April 2007 02:27  |
bitsun
Messages: 12 Registered: March 2007 Location: Germany
|
Promising Member |
|
|
I create a widget class myself,and i want to embed the widget in the TopWindow.
The code is simple,i would ignore the constructor:
struct VtkWidget : public DHCtrl
{
private:
Point p;
String text;
public:
typedef VtkWidget CLASSNAME;
myVTKApp *theVTKApp;
VtkWidget();
LRESULT WindowProc(/*HWND hWnd,*/UINT message, WPARAM wParam, LPARAM lParam);
LRESULT VtkWidget::WindowProc(/*HWND hWnd,*/UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE:
{
theVTKApp = new myVTKApp(GetHWND());
MessageBox (NULL, TEXT ("vtk sub window is created!"), TEXT ("HelloMsg"), 0);
return 0;
}
// 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:
//case 0x81: //this is WM_NCCREATE
if (theVTKApp->iren->GetInitialized())
{
return vtkHandleMessage2(GetHWND(), message, wParam, lParam, theVTKApp->iren);
}
break;
}
return DHCtrl::WindowProc(message, wParam, lParam);
}
I want the vtk to take over the message handling.
The problem is that WM_Create can be fired ,but other message can not, and after WM_CREATE it keeps firing WM_NCCREATE(I am sure, since i put a breakpoint before the if ,and the message==0x81),thats strange.
Does anybody know what might be wrong? maybe the WindowProc does sth that I do not know.
|
|
|
|
Goto Forum:
Current Time: Sun Jun 01 16:02:14 CEST 2025
Total time taken to generate the page: 0.02712 seconds
|