void CStudentDlg::ShowFullScreen()
{
GetWindowPlacement(&wndPre);
m_fullFlag = 1;
CRect winRect;
CRect cliRect;
int fullWidth=0;
int fullHeigth=0;
GetWindowRect(&winRect);
RepositionBars(0,0xffff,AFX_IDW_PANE_FIRST,reposQuery,&cliRect);
ClientToScreen(&cliRect);
// 获取屏幕的分辨率
fullWidth=GetSystemMetrics(SM_CXSCREEN);
fullHeigth=GetSystemMetrics(SM_CYSCREEN);
//将除控制条外的客户区全屏显示到从(0,0)到(nFullWidth, nFullHeight)区域,
//将(0,0)和(nFullWidth, nFullHeight)两个点外扩充原窗口和除控制条之外的 客户区位置间的差值, 就得到全屏显示的窗口位置
m_fullScreenRect.left=winRect.left-cliRect.left;
m_fullScreenRect.top=winRect.top-cliRect.top;
m_fullScreenRect.right=winRect.right-cliRect.right+fullWidth;
m_fullScreenRect.bottom=winRect.bottom-cliRect.bottom+fullWidth;
//全屏显示
WINDOWPLACEMENT wndPl;
wndPl.length=sizeof(WINDOWPLACEMENT);
wndPl.flags=0;
wndPl.showCmd=SW_SHOWNORMAL;
wndPl.rcNormalPosition=m_fullScreenRect;
SetWindowPlacement(&wndPl);
}
void CStudentDlg::OnShow()
{
if (m_fullFlag != 1)
{
ShowFullScreen();
}
WINDOWPLACEMENT wndPl;
wndPl.length=sizeof(WINDOWPLACEMENT);
wndPl.flags=0;
wndPl.showCmd=SW_SHOWNORMAL;
wndPl.rcNormalPosition=m_fullScreenRect;
SetWindowPlacement(&wndPl);
int res=0;
int cx=GetSystemMetrics(SM_CXSCREEN);
int cy=GetSystemMetrics(SM_CYSCREEN);
CClientDC dc(this);
StretchDIBits(dc.m_hDC,0,0,cx,cy,0,0,cx,cy,m_buf,m_bmpHead.dibInfo,DIB_RGB_COLORS,SRCCOPY);
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。