I am using functions like these:
Extern "win32"
Function GetActiveWindow()
Function GetWindowLongA(hWnd%, nIndex%) = "GetWindowLongA@8"
Function SetWindowLongA(hWnd%, nIndex%, uFlags%) = "SetWindowLongA@12"
Function DrawMenuBar%(hMenu%)
End Extern
Const WS_MAXIMIZEBOX:Long = $10000
Const WS_MINIMIZEBOX:Long = $20000
Const GWL_STYLE:Int = -16
Function disableMaximize(hWnd:Long)
Local tmp:Long = GetWindowLongA( hWnd, GWL_STYLE )
Local tmp2:Long = tmp And WS_MAXIMIZEBOX
tmp = tmp - tmp2
SetWindowLongA( hWnd, GWL_STYLE, tmp )
DrawMenuBar( hWnd )
End Function
Function enableMaximize(hWnd:Long)
Local tmp:Int = GetWindowLongA( hWnd, GWL_STYLE )
tmp = tmp | WS_MAXIMIZEBOX
SetWindowLongA( hWnd, GWL_STYLE, tmp )
DrawMenuBar( hWnd )
End Function
Function disableMinimize(hWnd:Long)
Local tmp:Long = GetWindowLongA( hWnd, GWL_STYLE )
Local tmp2:Long = tmp And WS_MINIMIZEBOX
tmp = tmp - tmp2
SetWindowLongA( hWnd, GWL_STYLE, tmp )
DrawMenuBar( hWnd )
End Function
Function enableMinimize(hWnd:Long)
Local tmp:Long = GetWindowLongA( hWnd, GWL_STYLE )
tmp = tmp | WS_MINIMIZEBOX
SetWindowLongA( hWnd, GWL_STYLE, tmp )
DrawMenuBar( hWnd )
End Function
' example
local handle:long = GetActiveWindow()
enableMinimize( handle )
[edit]
I haven't tried checking what the status of them is before changing them but I am thinking that if you do a "GetWindowLongA( hWnd, GWL_STYLE )" and then check against those bits that the conts contain, it should tell you whether or not they are enabled or disabled. Unless you mean check whether or not the application is minimized or not, then that would be something with the focus of the application. I am quite new to all this winApi stuff, so perhaps someone else got some code for that.