# re: Win32 的框架代码 回复 更多评论
2008-01-20 16:45 by
固定窗口的大小:
case WM_GETMINMAXINFO:
{
// Don't allow resizing in windowed mode.
// Fix the size of the window to 640x480 (client size)
MINMAXINFO* pMinMax = (MINMAXINFO*) lParam;
DWORD dwFrameWidth = GetSystemMetrics( SM_CXSIZEFRAME );
DWORD dwFrameHeight = GetSystemMetrics( SM_CYSIZEFRAME );
DWORD dwMenuHeight = GetSystemMetrics( SM_CYMENU );
DWORD dwCaptionHeight = GetSystemMetrics( SM_CYCAPTION );
pMinMax->ptMinTrackSize.x = WINDOW_WIDTH + dwFrameWidth * 2;
pMinMax->ptMinTrackSize.y = WINDOW_HEIGHT + dwFrameHeight * 2 +
dwMenuHeight + dwCaptionHeight;
pMinMax->ptMaxTrackSize.x = pMinMax->ptMinTrackSize.x;
pMinMax->ptMaxTrackSize.y = pMinMax->ptMinTrackSize.y;
}
return 0L;
# re: Win32 的框架代码 回复 更多评论
2008-12-11 11:00 by
case WM_GETMINMAXINFO:
WIDTH_WIDTH是楼主自定义(640)吗?
如果这样,pMinMax->ptMinTrackSize.x
=WINDOW_WIDTH+dwFrameWidth*2-GetSystemMetrics(SM_CXBORDER)。更准确一点.
pMinMax->ptMinTrackSize.y类似。