Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
bitsun is currently offline  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.
Re: how is the WindowProc of DHCtrl working? [message #9036 is a reply to message #9034] Sat, 14 April 2007 23:56 Go to previous message
mirek is currently offline  mirek
Messages: 14260
Registered: November 2005
Ultimate Member
I am not quite sure what is wrong, however, WM_NCCREATE is used to bing C++ object to window handle (for DHCtrl).

See Win32Wnd.cpp 436 Ctrl::WndProc for details.

Mirek
Previous Topic: Layouts, sizers etc
Next Topic: HasFocus and popup widnows
Goto Forum:
  


Current Time: Sun Jun 01 15:53:03 CEST 2025

Total time taken to generate the page: 0.01747 seconds