here's the code:
Code: Select all
Procedure WinProc(hWnd, msg, wParam, lParam)
Protected.i result
result = #PB_ProcessPureBasicEvents
If msg = #WM_SYSCOMMAND
If wparam = #SC_MINIMIZE
Debug "Minimized"
result = 0
ElseIf wParam = #SC_CLOSE
Debug "Closed"
result = 0
ElseIf wparam = #SC_RESTORE
Debug "Restored"
result = 0
EndIf
EndIf
ProcedureReturn result
EndProcedure
If OpenWindow(0, 0, 0, 320, 240, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget)
;SetWindowCallback(@WinProc())
Repeat
Event = WaitWindowEvent()
Select Event
Case #WM_SYSCOMMAND
Select EventwParam()
Case #SC_CLOSE
Debug "Close"
Case #SC_MINIMIZE
Debug "Minimize"
Case #SC_RESTORE
Debug "Restore"
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
With my best,
Bruno