2011-08-10 21 views

Respuesta

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

A continuación, compruebe si esa ventana no es de escritorio o shell. Simple si la instrucción.

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

Esto está escrito sin pruebas.

+0

Muchas gracias, esta misma ayuda! – lebron2323

1

Una implementación completa de la respuesta de Hooch:

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); 
} 
Cuestiones relacionadas