Hey all just a quick question.

I want to write a MDI application (with menu) that has two panes seperated by a vertical splitter bar. In the right pane I want a normal window with a tree list, and in the right pane I want to be able to open multiple windows.

- Which window do I have to define as the frame window (is it the main window or do I have to create the frame window in the left pane)?
- And if I create the frame window in the left pane what about access to the menu (window list)?

Sorry about all the questions but I thought it better to ask before getting myself totally confused.


Posted on 2002-01-08 19:23:05 by Maelstrom
Hi Maelstrom

An mdi consist of a mdi frame, mdi client and mdi child's. The mdi frame will be the owner of the menu, your list and the mdi client. The mdi client is the owner of the mdi childs. To put a list on the mdi frame you must resize the mdi client to make room for your list.

Posted on 2002-01-08 20:25:49 by KetilO
Thanks for the help KetilO.

I have another question for ya.

I threw together a simple test app with a frame window, client window, and a window that contains a tree view control. I resized the client window to allow room for the window containing the tree control, but the window title bar displays as unselected (greyed out) and doesn't change when I click inside the window. I also have items in the tree control but when I add sub-items, the + box won't appear until I select the parent item.

What have I done wrong?

I defined the window as a child window of the frame window, and the msg proc uses DefWindowProc, is this correct?

Are there any messages that must be passed to the parent window even if I process them?


Posted on 2002-01-09 16:40:28 by Maelstrom
Hi Maelstrom

A window that is a child does not behave properly. Skip the window and make the treeview a child of the mdi frame. You can also do somthing like this:

Posted on 2002-01-09 17:50:45 by KetilO
Thanks KetilO

I'll try making the treeview a child before trying to absorb the code you posted.

I let you know if I have any more Qs

Damn I love this board!


Posted on 2002-01-10 16:46:35 by Maelstrom
I think XP hates me or I'm getting dumber!

I made the treeview a child of the frame window but it still won't update.

I put 3 parent items in the treeview when it's created (WM_CREATE frame msg proc) and these show up fine. But when I try to add children to these the treeview won't update until I click on the parent item (the [+] box won't appear).

I use the following function to insert items into the treeview

AppInsertItem proc hParent:dword,pItem:dword

mov eax,hParent
mov ecx,pItem
mov tvi.hParent,eax
mov tvi.hInsertAfter,TVI_SORT
mov tvi.item.pszText,ecx
mov tvi.item.imask,TVIF_TEXT
invoke SendMessage,hTreeView,TVM_INSERTITEM,0,addr tvi

AppInsertItem endp

tvi is defined in the data segment.

If I call UpdateWindow() after SendMessage() the child items don't seem to get added at all and if I use TVM_EXPAND to expand the parent the child items get added to the root.


And as a side note, I've just started using RadASM (awesome work KetilO) but when I try to build I get the error (cannot open input file Files\Microsoft.obj) - WTF? Not sure what to do since theres no docs, compiles fine, just won't build.


Any help would be appreciated.


Posted on 2002-01-11 14:45:40 by Maelstrom

And as a side note, I've just started using RadASM (awesome work KetilO) but when I try to build I get the error (cannot open input file Files\Microsoft.obj) - WTF? Not sure what to do since theres no docs, compiles fine, just won't build.

Maelstrom :confused:
Go into your project setting and put quotes around $L to allow strings in the path for the LIBs. You most likely want to do this for the default project options and all templates/project types. This should be fixed in the distribution as all versions of LINK I know of support this (KetilO)
Posted on 2002-01-11 16:07:53 by bitRAKE
Cheers bitRAKE, that fixed that problem.

Still no luck with the treeview prob tho. I changed the prog to SDI in case I made some stuffup in the MDI code but no change. I also looked at some examples in the MASM32 package and found that child windows seem to be the same there too!

I've tried to manually update the child windows by using UpdateWindow and SendMessage but nothing seem to work. They do update when I resize the window tho - aarrhg.

I must be overlooking something surely!


Posted on 2002-01-11 17:45:26 by Maelstrom
Did you look at Ewayne's example in the Example8 folder I believe?
Posted on 2002-01-11 18:08:51 by bitRAKE