EnableExplicit Define EventID Procedure WinCallback(hWnd, uMsg, wParam, lParam) If uMsg = #WM_ENDSESSION ;Windows wird heruntergefahren. ;Hier können noch wichtige Einstellungen gespeichert werden. EndIf ProcedureReturn #PB_ProcessPureBasicEvents EndProcedure If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) SetWindowCallback(@WinCallback()) Repeat EventID = WaitWindowEvent() If EventID = #PB_Event_CloseWindow End EndIf ForEver EndIf