代码如下:
int nFullWidth = GetSystemMetrics(SM_CXSCREEN);
int nFullHeight = GetSystemMetrics(SM_CYSCREEN);
CRect m_FullScreenRect;
CRect WindowRect;
GetWindowRect(&WindowRect);
CRect ClientRect;
RepositionBars(0, 0xFFFF, AFX_IDW_PANE_FIRST, CWnd::reposQuery, &ClientRect);
ClientToScreen(&ClientRect);
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.length = sizeof(WINDOWPLACEMENT);
wndpl.flags = 0;
wndpl.showCmd = SW_SHOWNORMAL;
wndpl.rcNormalPosition = m_FullScreenRect;
SetWindowPlacement(&wndpl);
本文介绍了在MFC应用程序中如何将窗口设置为全屏显示。通过修改窗口的大小和位置,使得窗口占据整个屏幕,从而实现全屏效果。详细代码示例给出了解决方案。
592

被折叠的 条评论
为什么被折叠?



