Posted: Fri Aug 25, 2006 8:08 am
Hi PB - I'm pretty sure it was a (feeble? did I say that?) joke.
http://www.purebasic.com
https://www.purebasic.fr/english/
I got the "Already Running!" box after re-running it. As I type this I see it is still in the Task Manager quite a while later (about a minute later ). I guess I've got some fundamental system problem here.. I'll investigate some more. Thanks netmaestro alot for your kind help.netmaestro wrote:OK, one more test. Run this code, close the window and then immediately try to run it again.
You people don't have humour.netmaestro wrote:Hi PB - I'm pretty sure it was a joke.
No, you didn't.(feeble? did I say that?)
Code: Select all
Procedure Init()
InitSprite()
OpenWindow(0, 0, 0, 800, 600, "test", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
EndProcedure
Procedure MainLoop()
quit.l = 0
Repeat
eventID = WaitWindowEvent()
Until quit = 1 Or eventID = #PB_Event_CloseWindow
CloseScreen()
CloseWindow(0)
MessageRequester("End", "Before end")
End
MessageRequester("End", "After end")
EndProcedure
Init()
MainLoop()Code: Select all
Procedure Init()
InitSprite()
InitKeyboard()
OpenWindow(0, 0, 0, 800, 600, "test", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
EndProcedure
Procedure MainLoop()
quit.l = 0
ExamineKeyboard()
Repeat
eventID = WaitWindowEvent()
Until quit = 1 Or eventID = #PB_Event_CloseWindow
CloseScreen()
CloseWindow(0)
End
EndProcedure
Init()
MainLoop()Code: Select all
InitSprite()
InitKeyboard()
OpenWindow(0, 0, 0, 800, 600, "test", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
ExamineKeyboard()
Repeat
Delay(1)
eventID = WindowEvent()
Until eventID = #PB_Event_CloseWindow
CloseScreen()
CloseWindow(0)
End Code: Select all
eventID = WaitWindowEvent(1) Code: Select all
InitSprite()
InitKeyboard()
OpenWindow(0, 0, 0, 800, 600, "test", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
;ExamineKeyboard()
GetAsyncKeyState_(#PB_Key_Escape)
Repeat
eventID = WaitWindowEvent()
Until eventID = #PB_Event_CloseWindow
CloseScreen()
CloseWindow(0)
End Code: Select all
InitSprite()
InitKeyboard()
;
If OpenWindow(0, 0, 0, 800, 600, "test", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
;
If OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
;
ExamineKeyboard()
;
quit.l = 0
;
Repeat
EventID = WaitWindowEvent()
Until quit = 1 Or EventID = #PB_Event_CloseWindow
;
CloseScreen()
;
EndIf
;
CloseWindow(0)
;
EndIf
;
End Code: Select all
If KeyboardPushed(#PB_Key_Escape) : quit = 1 : EndIfI think it's not possible to do it (gets an error)Xombie wrote:Another thing to try on yours ... put ExamineKeyboard() before OpenWindowedScreen() and try it.
Yes..: Edit :.. And does this still stay in memory?
Still stays in memory...: Edit 2 :.. And what happens if you add ...... that line somewhere in your loop? Just curious to see what happensCode: Select all
If KeyboardPushed(#PB_Key_Escape) : quit = 1 : EndIf