2

In order to split a window into 2, for example, viewing 2 documents at the same time, we created 2 child windows and a split bar to resize the child windows.

But I have seen many applications which have multiple panels without a split bar. In fact, there is a 'line' between the panels, but I found that they created an extra child window hwndChild1Container which contains the first child window hwndChild1 and the size is a litte wider than hwndChild1, hence there is a bar as we see.

My question is: In order to do the same thing, I don't know which window style I have to use for hwndChild1Container. I don't want hwndChild1Container has a board like the main window, but I need it being resizeable and when the mouse is over the right boarder, the cursor changes the shape like the case for main window. Is there a build-in window style for such child window, or I have to do this manually in the window procedure of hwndChild1Container?

user565739
  • 1,302
  • 4
  • 23
  • 46
  • Does it need any special style? just make it slightly wider than its child as you suggested, – Deanna May 31 '12 at 10:02
  • 2
    Another approach is to use just the windows you already have, a parent container containing some child windows, you actually don't need any additional windows: if the child windows are sized so that there's a gap between them such that the parent/container window is visible 'behind' them, then that parent/container can act as the bar. The parent container window can then draw its background appropriately and handle the WM_SETCURSOR messages and mouse clicks to get the right behavior, resizing the child windows as appropriate. – BrendanMcK Jun 01 '12 at 05:02

1 Answers1

0

Container does not need any special styles. Just process WM_NCHITTEST for container and return HTBOTTOM for bottom pixels.

Maximus
  • 10,751
  • 8
  • 47
  • 65