6.2. CSplitterWnd FAQs

Microsoft Visual C++/Microsoft Foundation Classes


6.2. CSplitterWnd FAQs

%%TODO - add lots of these, email us your toughest ones.

FYI - MFC Internals has a whole chapter devoted to this - it's my personal favorite MFC class because it has lots of interesting internals, shortcomings, odd behaviors, etc..

We wrote a DDJ article where we show how to swap the splitter from horizontal to vertical. I think the code is at http://www.ddj.com if you are interested.

[email protected] - Scot Wingo

UPD!! 6.2.1. How do I create non-resizable (static AND fixed) splitter bars?

See KB article Q105150 "Preventing Static Splitters from Tracking". It describes how to do this. Basically, derive a class from the CSplitterWnd and override the left button and mouse move messages: call the CWnd versions rather than CSplitterWnd versions. Finally, remove menu items that may generate ID_WINDOW_SPLIT commands.

[email protected], via mfc-l 9/28/95

To add to the above answer, you should also handle the WM_SETCURSOR message and just call the CWnd version so that the horizontal and vertical resize pointers are not shown.

BOOL CMySplitterWnd::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
    return CWnd::OnSetCursor(pWnd, nHitTest, message);
}

Michael Pickens, [email protected]