RunProgram and PB_Program_Wait mouse cursor issue

Windows specific forum
PureGuy
Enthusiast
Enthusiast
Posts: 102
Joined: Mon Aug 30, 2010 11:51 am

RunProgram and PB_Program_Wait mouse cursor issue

Post 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?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: RunProgram and PB_Program_Wait mouse cursor issue

Post 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

BERESHEIT
Post Reply