Recently to do a project, do interface encountered this problem, find a lot of information, finally solved, in this record, I hope to have the need to help people. Well, not much to say, the specific treatment is as follows:
Create a new class Cfixsplitterwnd inherit CSplitterWnd, add
On_wm_lbuttondown ()
On_wm_setcursor ()
On_wm_mousemove ()
Three message responses, the main code is as follows:
Header file
1 protected : 2 void OnLButtonDown (UINT nflags, CPoint PT); 3 afx_msg BOOL onsetcursor (cwnd* pWnd, uint nhittest, UINT message); 4 void OnMouseMove (UINT nflags, CPoint PT); 5 Declare_message_map ()
source file
Begin_message_map (Cfixsplitterwnd, CSplitterWnd) On_wm_lbuttondown () On_wm_setcursor () On_wm_mousemove () END_ Message_map ()voidCfixsplitterwnd::onlbuttondown (UINT nflags, CPoint point) {//return directly, do not process return; } BOOL Cfixsplitterwnd::onsetcursor (CWnd*pWnd, uint nhittest, UINT message) { //when the cursor enters the split window, it is not allowed to change appearance, do not handle returnFALSE;}voidCfixsplitterwnd::onmousemove (UINT nflags, CPoint point) {//change the processing of the Csplitter class to be handled by CWnd//Csplitterwnd::onmousemove (nflags, point);Cwnd::onmousemove (nflags, point);}