先用GetSystemMetrics(SM_CXSCREEN)与GetSystemMetrics(SM_CYSCREEN)取得屏幕大小,
nFullWidth=GetSystemMetrics(SM_CXSCREEN);
nFullHeight=GetSystemMetrics(SM_CYSCREEN)
然后取得窗口矩形GetWindowRect(&WindowRect);
设置全屏矩形的参数:
FullScreenRect.left=WindowRect.left;
FullScreenRect.top=WindowRect.top;
FullScreenRect.right=WindowRect.right+nFullWidth;
FullScreenRect.bottom=WindowRect.bottom+nFullHeight;
最后用SetWindoiwPlacement()进入全屏状态:
WINDOWPLACEMENT wndpl;
wndpl.length=sizeof(WINDOWPLACEMENT);
wndpl.flags=0;
wndpl.rcNormalPositioin=m_FullScreenRect;
wndpl.ShowCmd=SW_SHOWNORMAL;
SetWindowPlacement(&wndpl);
这样就可以进入全屏状态了,如果想要恢复原始屏幕的话,先用GetWindowPlacement(&Oldwndpl);
保存原始参数,接到恢复消息后,用SetWindowPlacement(&Oldwndpl)就行了。
我能说的就这么多了,不知道你明白了没有。[?]