确定对话框框架边框的大小及重绘

来源:互联网 发布:剑灵最美天族捏脸数据 编辑:程序博客网 时间:2024/06/14 01:27
void CMainFrame::DrawTitleBar(CDC *pDC){// TODO: 在此处添加消息处理程序代码// 不为绘图消息调用 CFrameWnd::OnNcPaint()pDC->SelectStockObject(NULL_BRUSH);   pDC->SelectStockObject(NULL_PEN);CRect rtWnd, rtTitle, rtButtons;GetWindowRect(&rtWnd);//取得标题栏的位置//SM_CXFRAME 窗口边框的边缘宽度//SM_CYFRAME 窗口边框的边缘高度//SM_CXSIZE  窗口标题栏宽度//SM_CYSIZE  窗口标题栏高度rtTitle.left = GetSystemMetrics(SM_CXFRAME); rtTitle.top = GetSystemMetrics(SM_CYFRAME);  rtTitle.right = rtWnd.right - rtWnd.left - GetSystemMetrics(SM_CXFRAME);rtTitle.bottom = rtTitle.top + GetSystemMetrics(SM_CYSIZE);CPoint point;//填充顶部框架point.x = rtWnd.Width();point.y = GetSystemMetrics(SM_CYSIZE) + GetSystemMetrics(SM_CYFRAME) + 0;pDC->Rectangle(0, 0, point.x, point.y);//填充左侧框架point.x = GetSystemMetrics(SM_CXFRAME) -1;point.y = rtWnd.Height()- 1;pDC->Rectangle(0, 0, point.x, point.y);//填充底部框架point.x = rtWnd.Width(); point.y = GetSystemMetrics(SM_CYFRAME);pDC->Rectangle(0, rtWnd.Height()-point.y, point.x, point.y);//填充右侧框架point.x = GetSystemMetrics(SM_CXFRAME);point.y = rtWnd.Height();pDC->Rectangle(rtWnd.Width()-point.x, 0, point.x, point.y);}
	
				
		
原创粉丝点击