2011-08-10 57 views

Trả lời

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

Sau đó kiểm tra xem cửa sổ đó không phải là máy tính để bàn hay vỏ. Đơn giản nếu hướng dẫn.

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

Điều này được viết mà không cần kiểm tra.

+0

Cảm ơn rất nhiều, điều này rất giúp đỡ! – lebron2323

1

Một thực hiện đầy đủ các câu trả lời Hooch của:

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); 
} 
Các vấn đề liên quan