The previous section explains how to split the window in a static way, split the window after the split line can be dragged, sometimes we need to fix the split line, then how to achieve fixed segmentation?
We need to construct a fixed split window class (Cfixedsplitterwnd) to implement our fixed segmentation of Windows, described in the previous chapter.
1. New MFC classes are created, inherited from CSplitterWnd, and overloaded with Wm_lbuttondown, wm_mousemove, and wm_setcursor message response functions.
2. The newly constructed Cfixedsplitterwnd uses the same method as the CSplitterWnd.
With the MFC Class Wizard, when you construct Cfixedsplitterwnd, you cannot find the base class CSplitterWnd, you can select CWnd first and then manually change the base class to CSplitterWnd.
Overloaded Wm_lbuttondown, wm_mousemove, and wm_setcursor message response functions
Cfixedsplitterwndメッセージハンドラーvoid Cfixedsplitterwnd::onlbuttondown (UINT nflags, CPoint point) {//todo:ここにメッセージハンドラー コードを additional するか, established Hishinuma accolades out します. Csplitterwnd::onlbuttondown (nflags, point); Cwnd::onlbuttondown (nflags, point);} void Cfixedsplitterwnd::onmousemove (UINT nflags, CPoint point) {//Todo:ここにメッセージハンドラーコードを append するか, established Hishinuma, accolades out します. Csplitterwnd::onmousemove (nflags, point); Cwnd::onmousemove (nflags, point);} BOOL cfixedsplitterwnd::onsetcursor (cwnd* pWnd, uint nhittest, UINT message) {//Todo:ここにメッセージハンドラーコードを append するか, The established Hishinuma accolades out します. Return Csplitterwnd::onsetcursor (pWnd, nhittest, message); return Cwnd::onsetcursor (PWnd, nhittest, message);}