BOOL IsFullScreenMode()
{
BOOL bRet = FALSE;
HWND hDesktopWindow = GetDesktopWindow();
HWND hShellWindow = GetShellWindow();
DWORD dwDesktopWindow = 0, dwShellWindow = 0;
GetWindowThreadProcessId(hDesktopWindow, &dwDesktopWindow);
GetWindowThreadProcessId(hShellWindow, &dwShellWindow);
const INT nWidth = GetSystemMetrics(SM_CXSCREEN);
const INT nHeight = GetSystemMetrics(SM_CYSCREEN);
DWORD dwTmp = 0;
HWND hTmp = FindWindowEx(NULL, NULL, NULL, NULL);
while (hTmp != NULL)
{
CRect rect;
GetWindowRect(hTmp, &rect);
if (nWidth == rect.Width() && nHeight == rect.Height())
{
GetWindowThreadProcessId(hTmp, &dwTmp);
if (dwTmp != dwShellWindow && dwTmp != dwDesktopWindow)
{
bRet = TRUE;
TRACE("FullScreen:%d\n", dwTmp);
break;
}
}
hTmp = FindWindowEx(NULL, hTmp, NULL, NULL);
}
return bRet;
}
posted on 2010-11-26 21:57
张志松 阅读(756)
评论(0) 编辑 收藏 引用 所属分类:
VC/MFC