Page 1 of 1

RunProgram and PB_Program_Wait mouse cursor issue

Posted: Thu Sep 22, 2011 4:00 pm
by PureGuy
Hi,

i just wonder why a line like this causes a 10 - 15 seconds busy mouse cursor

Code: Select all

RunProgram("cmd.exe", "", "", #PB_Program_Wait)
it's of course not a problem, but i don't get it why it is happening :?:

Anyone has an idea, how to fix this?

Re: RunProgram and PB_Program_Wait mouse cursor issue

Posted: Thu Sep 22, 2011 4:38 pm
by netmaestro
This is going to happen with virtually any code that doesn't open a window when it's run directly from the IDE. In a more real-world scenario it won't happen:

Code: Select all

OpenWindow(0,0,0,320,240,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
ButtonGadget(0,10,10,100,20,"Run CMD")

Repeat
  ev=WaitWindowEvent()
  If ev=#PB_Event_Gadget And EventGadget() = 0
    RunProgram("cmd.exe", "", GetCurrentDirectory(), #PB_Program_Wait)
  EndIf
Until ev= #PB_Event_CloseWindow