你的这个需求有种情况必须处理.
就是对WM_SIZE,禁止把窗口的高度调整到小于24个像素的情况.void YourWnd::OnSize( UINT nType, int cx, int cy )
{
if (cy < 24)
cy = 24;
CWnd::OnSize(cx, cy);
}
就是对WM_SIZE,禁止把窗口的高度调整到小于24个像素的情况.void YourWnd::OnSize( UINT nType, int cx, int cy )
{
if (cy < 24)
cy = 24;
CWnd::OnSize(cx, cy);
}
解决方案 »
- vb 连接Access出现问题,请指点
- 菜鸟的问题:如何通过按钮关闭窗体!!!!!
- 如何用vb做word控件?请专家指教,俺特紧急
- floodfill定义新坐标系后无法填充颜色问题,VB,
- 如何绑定Recordset对象到一个DATADRID控件,而完全不用DATA控件,请大家教我。一个小时后结帐。
- 我要学北大青鸟ACCP了,请大家给点意见?
- 急,VB程序如何用外接程序打开chm帮助
- 我想学VB,但6.0和.net哪个更好呢?
- 各位,我有问题向大家求救,拜托了!
- 我的意思是这样的,不要误会!!我急啊,高手快出招啊!
- 请教一个有关"将Label中的字发送到另一程序中的本文文档"的问题
- data1不能连到Microsoft Access数据库
fCalcValidRects = (BOOL) wParam; // valid area flag lpncsp = (LPNCCALCSIZE_PARAMS) lParam; // size calculation data or lpncsp = (LPRECT) lParam; // new window coordinates
typedef struct _NCCALCSIZE_PARAMS { // nccp
RECT rgrc[3];
PWINDOWPOS lppos;
} NCCALCSIZE_PARAMS;
The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes. WM_NCCALCSIZE
fCalcValidRects = (BOOL) wParam; // valid area flag lpncsp = (LPNCCALCSIZE_PARAMS) lParam; // size calculation data or lpncsp = (LPRECT) lParam; // new window coordinates
Parameters
fCalcValidRects
The value of wParam. If wParam is TRUE, it specifies that the application should indicate which part of the client area contains valid information. The system copies the valid information to the specified area within the new client area.
If wParam is FALSE, the application does not need to indicate the valid part of the client area. lpncsp
Value of lParam. If wParam is TRUE, lParam points to an NCCALCSIZE_PARAMS structure that contains information an application can use to calculate the new size and position of the client rectangle.
If wParam is FALSE, lParam points to aRECT structure. On entry, the structure contains the proposed window rectangle for the window. On exit, the structure should contain the screen coordinates of the corresponding window client area. Return Values
If the fCalcValidRects parameter is FALSE, the application should return zero. If fCalcValidRects is TRUE, the application should return zero or a combination of the following values: Value Meaning
WVR_ALIGNTOP, WVR_ALIGNLEFT, WVR_ALIGNBOTTOM, WVR_ALIGNRIGHT
These values, used in combination, specify that the client area of the window is to be preserved and aligned appropriately relative to the new position of the window. For example, to align the client area to the lower-left corner, return the WVR_ALIGNLEFT and WVR_ALIGNBOTTOM values.
WVR_HREDRAW, WVR_VREDRAW
These values, used in combination with any other values, cause the window to be completely redrawn if the client rectangle changes size horizontally or vertically. These values are similar to the CS_HREDRAW and CS_VREDRAW class styles.
WVR_REDRAW
This value causes the entire window to be redrawn. It is a combination of WVR_HREDRAW and WVR_VREDRAW values.
WVR_VALIDRECTS
This value indicates that, upon return from WM_NCCALCSIZE, the rectangles specified by the rgrc[1] and rgrc[2] members of the NCCALCSIZE_PARAMS structure contain valid destination and source area rectangles, respectively. The system combines these rectangles to calculate the area of the window to be preserved. The system copies any part of the window image that is within the source rectangle and clips the image to the destination rectangle. Both rectangles are in parent-relative or screen-relative coordinates.
This return value allows an application to implement more elaborate client-area preservation strategies, such as centering or preserving a subset of the client area.
If fCalcValidRects is TRUE and an application returns zero, the old client area is preserved and is aligned with the upper-left corner of the new client area. Default Action
The window may be redrawn, depending on whether the CS_HREDRAW or CS_VREDRAW class style is specified. This is the default, backward-compatible processing of this message by the DefWindowProc function (in addition to the usual client rectangle calculation described in the preceding table). 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, DefWindowProc, MoveWindow, SetWindowPos, NCCALCSIZE_PARAMS,RECT
The NCCALCSIZE_PARAMS structure contains information that an application can use while processing the WM_NCCALCSIZE message to calculate the size, position, and valid contents of the client area of a window. typedef struct _NCCALCSIZE_PARAMS { // nccp
RECT rgrc[3];
PWINDOWPOS lppos;
} NCCALCSIZE_PARAMS;
Members
rgrc
Specifies an array of rectangles. The first contains the new coordinates of a window that has been moved or resized. The second contains the coordinates of the window before it was moved or resized. The third contains the coordinates of the window's client area before the window was moved or resized. If the window is a child window, the coordinates are relative to the client area of the parent window. If the window is a top-level window, the coordinates are relative to the screen origin.
lppos
Pointer to a WINDOWPOS structure that contains the size and position values specified in the operation that moved or resized 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 Structures, MoveWindow,RECT, SetWindowPos, WINDOWPOS, WM_NCCALCSIZE
在框架类的OnCreate或OnCreateClient中加入ToolBar:
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM| CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_BOTTOM))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndToolBar.EnableDocking(CBRS_ALIGN_BOTTOM);
EnableDocking(CBRS_ALIGN_BOTTOM);
DockControlBar(&m_wndToolBar);你的IDR_BOTTOM中只有一个ITEM高度是24宽度是1。看着还是可以用的!或者你用拆分窗口吧。分上下两个区,下面是24 PIXELS.请看我的问题:http://www.csdn.net/expert/TopicView.asp?id=86163