EnableExplicit Define EventID If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) EnableMenuItem_(GetSystemMenu_(WindowID(0),#False), #SC_CLOSE, #MF_DISABLED) Repeat EventID=WaitWindowEvent() If EventID = #PB_Event_CloseWindow End EndIf ForEver EndIf