2011-08-10 83 views

回答

8
hWnd = GetForegroundWindow(); 
RECT appBounds; 
RECT rc; 
GetWindowRect(GetDesktopWindow(), &rc); 

然後檢查該窗口是不是桌面或外殼。 簡單如果指令。

if(hWnd =! GetDesktopWindow() && hWnd != GetShellWindow()) 
{ 
    GetWindowRect(hWnd, &appBounds); 
    // Now you just have to compare rc to appBounds 
} 

這是沒有測試寫的。

+0

非常感謝,這非常有助於! – lebron2323

1

完全實施霍赫的回答:

bool isFullscreen(HWND window) 
{ 
    RECT a, b; 
    GetWindowRect(window, &a); 
    GetWindowRect(GetDesktopWindow(), &b); 
    return (a.left == b.left && 
      a.top == b.top && 
      a.right == b.right && 
      a.bottom == b.bottom); 
}