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);
//將除控制條外的客戶(hù)區全屏顯示到從(0,0)到(nFullWidth, nFullHeight)區域,
//將(0,0)和(nFullWidth, nFullHeight)兩個(gè)點(diǎn)外擴充原窗口和除控制條之外的 客戶(hù)區位置間的差值, 就得到全屏顯示的窗口位置
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);
}