tags:

views:

32

answers:

2

I have several child windows, all with the same parent. I want to cascade/tile these windows and was happy to find the TileWindows and CascadeWindows functions. But they don't seem to work on my windows if they don't have a caption (and they don't have one)! With caption everything is fine. Why is this?

+1  A: 

Those are functions that were designed to work with MDI child windows. An MDI child window must have a caption. If they work with non-MDI child windows too (haven't tried) then surely Windows avoids moving a window that cannot easily be moved back by the user.

Hans Passant
You mean like Windows is afraid of accidentally moving a window out of the user's reach?
Heinrich Ulbricht
If a window doesn't have a caption then a user doesn't have an easy way to move the window.
Hans Passant
Well I assume I have to live with this fact :-/
Heinrich Ulbricht
A: 

Windows allows to tile / cascade windows only if the wsCaption flag of a window is set. This has to do with the original purpose, namely that these functions are mainly used in MDI applications. In addition these functions can also be used on a set of top level windows (right clicking on the task bar gives you respective menu entries) which typically have a titlebar.

iamjoosy
But why isn't anything of this mentioned in the documentation? I find this a rather hard restriction - especially if you have to stumble over it to learn it.
Heinrich Ulbricht
Maybe because MS thaught that noone would ever want to tile/cascade captionless windows as this functionality is closely tight to MDI. Remember in MDI these functions do more than just arrange the windows - e.g. the caption of a child window becomes the caption of the main window when it is maximized. In addition it looses its own caption.
iamjoosy