Just testing on any program with a maximized window (not a full-screen game), with the taskbar set to auto-hide, I get:
A_ScreenWidth = 1024, A_ScreenHeight = 768
[WinGetPos] width = 1032, height = 776
...and with the taskbar visible, the only difference is height = 748.
What's going on with window sizes bigger than the screen??
Notice that a full screen game, such as pinball, operates in a different video mode. This is different from maximizing a window.
Try the following experiment:
I think it demonstrates that the window size returned is a Windows "bug" (or feature?). In any case, the returned size is unreliable when the window is maximized.
F10::
WinGet, hw_active, ID, A
WinGetPos,,, w_w, w_h, ahk_id %hw_active%
WinGetClass, class, ahk_id %hw_active%
WinGetTitle, title, ahk_id %hw_active%
text :=
( Join
"A_ScreenWidth = " A_ScreenWidth ", A_ScreenHeight = " A_ScreenHeight
"`n[WinGetPos] width = " w_w ", height = " w_h
"`n`nclass = " class
"`ntitle = " title
)
VarSetCapacity( rect, 16 )
status := DllCall( "GetWindowRect", "uint", hw_active, "uint", &rect )
if ( ! status )
text = %text%`n`n[GetWindowRect] failed!
else
{
x1 := ReadInteger( "int4", &rect, 0, false )
y1 := ReadInteger( "int4", &rect, 4, false )
x2 := ReadInteger( "int4", &rect, 8, false )
y2 := ReadInteger( "int4", &rect, 12, false )
text :=
( Join
text "`n`n[GetWindowRect]"
"`nx1 = " x1 ", y1 = " y1 ", x2 = " x2 ", y2 = " y2
"`nwidth = " x2-x1 ", height = " y2-y1
"`n`nIsZoomed = " DllCall( "IsZoomed", "uint", hw_active )
)
}
return
F11::
MsgBox, %text%
return
F12::
ExitApp
TwosComplement( p_value, p_size )
{
return, ( p_value^( 2**( p_size*8 )-1 ) )+1
}
ReadInteger( p_type, p_address, p_offset, p_hex=true )
{
old_FormatInteger := a_FormatInteger
if ( p_hex )
SetFormat, integer, hex
else
SetFormat, integer, dec
if ( InStr( p_type, "u", false ) = 1 )
sign := false
else
sign := true
StringRight, size, p_type, 1
value = 0
loop, %size%
value := value+( *( ( p_address+p_offset )+( a_Index-1 ) ) << ( 8*( a_Index-1 ) ) )
if ( sign )
{
sign := ( *( p_address+p_offset+( size-1 ) ) ) >> 7
if ( sign )
value := -1*TwosComplement( value, size )
}
SetFormat, integer, %old_FormatInteger%
return, value
}