Try this code:
SuperStrict
Graphics 800, 600
?Win32
Extern "win32"
Function IsZoomed%(hWnd%) = "IsZoomed@4"
Function GetActiveWindow%()
End Extern
EnableMaximize(GetActiveWindow())
Function EnableMaximize(hWnd:Long)
?Win32
Local tmp:Int = GetWindowLongA( hWnd, GWL_STYLE )
tmp = tmp | WS_MAXIMIZEBOX
SetWindowLongA( hWnd, GWL_STYLE, tmp )
DrawMenuBar( hWnd )
?
End Function
?
Local paused% = False
Local maximised% = False
Repeat
Cls
While PeekEvent()
PollEvent()
Select EventID()
Case EVENT_APPSUSPEND
Print "APPSUSPEND"
paused = True
Case EVENT_APPRESUME
Print "APPRESUME"
paused = False
Case EVENT_APPTERMINATE
Print "APPTERMINATE"
End
End Select
?win32
If isZoomed(getActiveWindow())
Print "isZoomed!"
maximised = True
Else
maximised = False
EndIf
?
Wend
If paused Then
DrawText "PAUSED", 10 , 10
Else
For Local i% = 0 To 100
Plot Rnd(800), Rnd(600)
Next
EndIf
If maximised Then
DrawText "MAXIMISED", 10 , 40
Else
DrawText "NOT MAXIMISED", 10 , 40
EndIf
Flip
Until 0 = 1 ' forever :P
Only works for Windows though...
|