* scratches head *
Actually you could just use GetWindowState() alone but it would fire the event multiple times. But adding a boolean check should fix this:
Code: Select all
OpenWindow(0,0,0,400, 300,"",#PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget)
Repeat
Event = WaitWindowEvent()
If GetWindowState(0) = #PB_Window_Minimize And isMinimized = #False
If isMinimized = #False
isMinimized = #True
Debug "WINDOWS HAS BEEN MINIMIZED!"
EndIf
ElseIf GetWindowState(0) = #PB_Window_Normal And isMinimized = #True
isMinimized = #False
Debug "WINDOWS HAS BEEN RESTORED!"
EndIf
Until Event = #PB_Event_CloseWindow