MFC中有一個是DOC VIEW結構的程式(其中VIEW是繼承CFormView)在mainFrame里面有一個CDockablePane(放在底下),CDockablePanel往上拉的程序中會出現CFromView越來越小,如何保證FormView的最小大小呢?也就是不讓CDockablePane再往上拉升
uj5u.com熱心網友回復:
WM_GETMINMAXINFOThe WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.
WM_GETMINMAXINFO
lpmmi = (LPMINMAXINFO) lParam; // address of structure
Parameters
lpmmi
Value of lParam. Pointer to a MINMAXINFO structure that contains the default maximized position and dimensions, and the default minimum and maximum tracking sizes. An application can override the defaults by setting the members of this structure.
Return Values
If an application processes this message, it should return zero.
Remarks
The maximum tracking size is the largest window size that can be produced by using the borders to size the window. The minimum tracking size is the smallest window size that can be produced by using the borders to size the window.
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
See Also
Windows Overview, Window Messages, MoveWindow, SetWindowPos, MINMAXINFO
uj5u.com熱心網友回復:
那就不用停靠模式,而用浮動模式。uj5u.com熱心網友回復:
@趙4老師 WM_GETMINMAXINFO 還是不行呢,CDockablePane還是可以拖動uj5u.com熱心網友回復:
沒蒙對。
愛莫能助,另請高明吧。
uj5u.com熱心網友回復:
@syy64 浮動和停靠都要使用呢 ,有沒有其他方法呢 CDockable拖動的程序中 WM_MOUSEMOVE都是無法回應的uj5u.com熱心網友回復:
@趙4老師 好吧 還是很感謝。uj5u.com熱心網友回復:
重寫虛函式virtual BOOL IsResizable() const
{
return FALSE;
}
uj5u.com熱心網友回復:
@VisualEleven 已經試過 不行uj5u.com熱心網友回復:
CDockablePane::IsResizable()By default, dockable panes are resizable. To prevent resizing, override this method in a derived class and return FALSE. Note that a FALSE value leads to a failed ASSERT in CPane::DockPane. Use CDockingManager::AddPane instead to dock a pane within a parent frame.
Panes that cannot be resized can neither float nor enter auto-hide mode and are always located at the outer edge of the parent frame.
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/123972.html
標籤:界面
