视图全屏显示

视图全屏显示

//调用这个函数
void CMainFrame::OnFullScreen()
{	
	// TODO: Add your command handler code here	
	CRect WindowRect;
	GetWindowRect(&WindowRect);
	
	CRect ClientRect;		
	RepositionBars(0,0xffff,AFX_IDW_PANE_FIRST,reposQuery,&ClientRect);		
	ClientToScreen(&ClientRect);
		
	//获取屏幕的分辨率	
	int nFullWidth=GetSystemMetrics(SM_CXSCREEN);		
	int nFullHeight=GetSystemMetrics(SM_CYSCREEN);
		
	CRect m_FullScreenRect;
	m_FullScreenRect.left=WindowRect.left-ClientRect.left;	
	m_FullScreenRect.top=WindowRect.top-ClientRect.top;
	m_FullScreenRect.right=WindowRect.right-ClientRect.right+nFullWidth;		
	m_FullScreenRect.bottom=WindowRect.bottom-ClientRect.bottom+nFullHeight;
	
	//进入全屏显示状态		
	WINDOWPLACEMENT wndpl;		
	wndpl.rcNormalPosition=m_FullScreenRect;		
	SetWindowPlacement(&wndpl);		
}

你可能感兴趣的:(视图全屏显示)