`
CrackRen
  • 浏览: 168442 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

视图全屏显示

    博客分类:
  • VC++
 
阅读更多

//调用这个函数
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);		
}
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics