how can I keep a program running ...
BlitzMax Forums/BlitzMax Programming/how can I keep a program running ...
| ||
when not focused? I have a program that I want to idle in the background which watches another program and if that program crashes this program I am writing will restart it. I just need to know how to keep it running in the background because when its out of focus it wont execute the program and it sort of freezes. |
| ||
Events. Make it react to whatever event you want. If you want it to monitor something, your best bet is probably to create a timer and have your program check every time the timer ticks. |
| ||
yeah I tried that but waitevent seems to mess that up because its halts the program until an event is done. |
| ||
If PollEvent() Select EventID() ... End Select endif Use PollEvent(), not WaitEvent(). |
| ||
tried that and it seems to work, but once it restarts my other program then it stops responded. |
| ||
either 1) Its a bug. 2)Youve done somthing wrong I think its out of order to post "How do I do This", when you mean "I know you do it like this, but it doesnt work" EDIT. Rephrase to "I think its bad post policy to post... |
| ||
Well my app doesnt have much to it and I cant see any reason why it would stop responding when it executes another program. I am not sure what you mean about this post being out of order? |
| ||
How is it executing something else? Through createprocess or system_ ? The later will put it on hold as execfile in B3D does as well and your app will go on where it was after the executed file finished. CreateProcess should not suffer this problem unless the started app takes 100% cpu in which case your "starter app" could get out of "sync" with its timer ... |
| ||
ah thats why then :) because I am using system_ ill give it a shot at home thanks dreamora |