我是一个ATL新手,最近做了一个ATL控件,在测试容器里全屏正常但是在IE浏览器里却不能正常全屏。具体现象是,第一次全屏并取消全屏非常正常,之后再改变IE的大小全屏窗口就跑到屏幕的左上角而且全屏窗口只有控件在IE里面显示的大小。如果此时缩小IE的大小到比控件还小的时候,屏幕左上角的全屏窗口竟然也会跟着IE的大小变化。我用的是有窗口的ATL控件,在构造函数中已经设置了m_bWindowOnly = TRUE;
以下是我全屏的代码: 
if (!isFullScreen) //由全屏进入非全屏
{
LockWindowUpdate(TRUE);
::SetParent(m_hWnd, m_oldWndParent);
SetWindowPlacement(&m_oldWndPlacement);
::SetForegroundWindow(m_oldWndParent);  
::SetFocus(m_oldWndParent);
::SetFocus(m_hWnd);
LockWindowUpdate(FALSE);
}
else //由非全屏进入全屏
{
GetWindowPlacement(&m_oldWndPlacement);
int nScreenWidth = GetSystemMetrics(SM_CXSCREEN);
int nScreenHeight = GetSystemMetrics(SM_CYSCREEN); m_oldWndParent = ::GetParent(m_hWnd);
::SetParent(m_hWnd, GetDesktopWindow()); WINDOWPLACEMENT wp1;
ZeroMemory(&wp1, sizeof(WINDOWPLACEMENT));
wp1.length = sizeof(WINDOWPLACEMENT); wp1.showCmd = SW_SHOWNORMAL; wp1.ptMinPosition.x = 0;
wp1.ptMinPosition.y = 0;
wp1.ptMaxPosition.x = nScreenWidth;
wp1.ptMaxPosition.y = nScreenHeight;
wp1.rcNormalPosition.left = 0;
wp1.rcNormalPosition.top = 0;
wp1.rcNormalPosition.right = nScreenWidth;
wp1.rcNormalPosition.bottom = nScreenHeight;
SetWindowPlacement(&wp1);
::SetForegroundWindow(GetDesktopWindow());
::SetForegroundWindow(m_hWnd);
}运行环境:Windows7和XP,VS2008谢谢先:)