Smooth UI with messages to child windows
Posted on 2002-03-21
My problem is that when I send a message A to a child window of my SDI application previous event like opening menu will be executed after this message A is handled.
Let me explain a bit more.
My SDI application looks like the Windows explorer. Two views within the mainframe. The left view is a tree view, the right view displays information about the selected item in the left view. The amount of items in the tree view could be huge so I decided not to build the whole tree at initialisation but only build the childs of an item when the user asks to expand this item. But since some items have many childs it still takes a while before the user gets the control back.
I thought about a solution to send a message to the tree view which will build X items and then send the same message again. With the idea that between these messages the mainframe could handle other events before the next message is handled.
But this does not work :-(
I also thought about a second thread which does the building-tree-job. But I am not sure (yet) how this should work since the view is part of the UI.
Do you have any ideas or comments which lead to a solution for my problem?