(转)在单文档中:
1)
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
// TODO: Add your message handler code here and/or call default
lpMMI->ptMinTrackSize.x=655;
lpMMI->ptMinTrackSize.y=528;
lpMMI->ptMaxTrackSize.x=655;
lpMMI->ptMaxTrackSize.y=528;
CFrameWnd::OnGetMinMaxInfo(lpMMI);
}
2)
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.style&=~WS_MAXIMIZEBOX;
cs.style&=~WS_THICKFRAME;
cs.cx=400;
cs.cy=300;
return TRUE;
}
3)
//固定窗口的大小 400*400
void CMysteryDlg::OnSizing(UINT fwSide, LPRECT pRect)
{
if( pRect->right - pRect->left <400 )
pRect->right = pRect->left + 400;
if( pRect->bottom - pRect->top < 400 )
pRect->bottom = pRect->top + 400;
CDialog::OnSizing(fwSide, pRect);
}
有点闪烁>>
win32中:
case WM_CREATE:
style = GetWindowLong(hWnd, GWL_STYLE);
style = style & (~WS_THICKFRAME) | WS_DLGFRAME;
SetWindowLong(hWnd, GWL_STYLE, style);
break;
posted on 2008-05-27 16:49
小果子 阅读(1308)
评论(0) 编辑 收藏 引用 所属分类:
学习笔记