It's a fullscreen app, and when I press Alt-Tab, it then crashes at StartDrawing(ScreenOutput()), with "The specified output is NULL (0 value)."
Any clues why it happens and how to get around it?
Code: Select all
If InitSprite() = 0 Or InitSprite3D() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
MessageRequester("Error", "Can't open DirectX", 0)
End
EndIf
OpenScreen(800, 600, 32, "Simple Product Selector")
Repeat
ClearScreen(-1) ; white background
StartDrawing(ScreenOutput())
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(400 - (TextWidth("Sample Title Here") / 2), 10, "Sample Title Here",0,0)
StopDrawing()
FlipBuffers(1)
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
ForEver