I know some of you IDE coders out there will have done this.... i am creating an MDI app, and i want one of the system predefined windows as my mdi children (specifically the SysTreeView32 window). This should be possible, ya?

I ask this because my child windows are not showing up. I have created the frame window, and the client window. Then i create a child window (treeview), and add a couple of nodes to it. When i create the treeview, a valid handle is returned, i then subclass it (the new wndProc gets used successfully), and add nodes, *all* of this works fine, but the window does not show up. And interestingly, the new wndproc doesn't receive any WM_MOUSEMOVE messages.

For the treeview, i have the WS_VISIBLE style set, all the node additions return success. Checking with Spy++ shows that it is there, with correct styles, positions and class names, and its parent is the client window. ShowWindow() and UpdateWindow() make no difference. Is there any trick i have missed? Note that i don't think it has anything to do with the subclassing, the problem remains the same whether i subclass or not.

I am doing all this in a very similar way to Icz's tutorial #32, but with a predefined system window, and no menus.

Thanks for any help :)
Posted on 2002-08-31 08:26:39 by sluggy
I may just be blowing a lot of hot air, but perhaps the control requires a window(a mdi child) to "tie" it to?
Posted on 2002-08-31 08:40:12 by MArtial_Code
I may just be blowing a lot of hot air, but perhaps the control requires a window(a mdi child) to "tie" it to?
If it was a common control, then you would be absolutely correct, but SysTreeView32 is actually a window, already predefined in Windows, just like the standard RichEdit window.

This is a strange problem, the window is there, but not there. If it was a matter of being "invisible" due to having the same color as the parent (frame) window, then it would still receive WM_MOUSEMOVE messages, which it isn't. Yet Spy++ and my debugging both show that it is there.....

I am thinking that it is possibly because the predefined windows call DefWindowProc and do not call DefMDIChildProc, maybe that is the problem.
Posted on 2002-09-01 04:08:46 by sluggy
Mmmph, the problem was mine, what a dumbass :grin:

While rearranging the code one night, i accidentally cut the WS_VISIBLE style from the *client* window, so because it was invisible then all the children it contains were too. Duh. Good thing i didn't count how many hours i spent debugging this one, i would hate to know the total. Which goes to show how a problem which appeared so complex can be caused by something so simple as a typo, or missing a flag.
Posted on 2002-09-01 07:58:04 by sluggy