Here is the source code based on the PB exemple, it will be more useful than the executable:
Code:
If InitSprite() = 0
MessageRequester("Error", "Can't open screen & sprite environment!", 0)
End
EndIf
Procedure __OnSizeWindow()
ClearScreen(RGB(0, 0, 200)) ; A blue background
DisplaySprite(0, 10, 10) ; Display our black box at the left-top corner
DisplaySprite(0, WindowWidth(0) - 60, 10) ; Display our black box at the right-top corner
FlipBuffers()
EndProcedure
ExamineDesktops()
If OpenWindow(0, 0, 0, 320, 200, "A screen in a window...", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
SetWindowColor(0,RGB(0,0,200))
BindEvent( #PB_Event_SizeWindow, @__OnSizeWindow(), #PB_All, #PB_All, #PB_All )
If OpenWindowedScreen(WindowID(0),0,0,DesktopWidth(0),DesktopHeight(0))
CreateSprite(0, 50, 50) ; Create an empty sprite, will be whole black
Repeat
; It's very important to process all the events remaining in the queue at each frame
;
Repeat
Event = WaitWindowEvent(10)
If Event = #PB_Event_CloseWindow
End
EndIf
Until Event = 0
ClearScreen(RGB(0, 0, 200)) ; A blue background
DisplaySprite(0, 10, 10) ; Display our black box at the left-top corner
DisplaySprite(0, WindowWidth(0) - 60, 10) ; Display our black box at the right-top corner
FlipBuffers()
ForEver
Else
MessageRequester("Error", "Can't open windowed screen!", 0)
EndIf
EndIf