CornMaster
09-13-2000, 11:53 AM
It there anyway to make my app restart? I figured that when the user want's to restart it, it will actually open another program that would just be a timer for like 1 ms and then when the timer expires would open my program again.
Is there any easier way?
CornEmpire Board Administrator
<A HREF="http://www.geocities.com/thecornmaster/" target="_new">http://www.geocities.com/thecornmaster/</A>
BillSoo
09-13-2000, 12:49 PM
I'm not sure what you mean by restart.
Do you mean
1) the main program is not running
2) the user clicks on the desktop icon
3) another program runs
4) this program ends and runs the main program
5) the main program runs
If so, you could just have the program run the main program using the Shell command.
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
CornMaster
09-13-2000, 01:05 PM
Yeah That's what I said/meant. I was wondering if there was another way?
CornEmpire Board Administrator
<A HREF="http://www.geocities.com/thecornmaster/" target="_new">http://www.geocities.com/thecornmaster/</A>
Valkyrie
09-13-2000, 01:39 PM
CornMaster,
It appears you and Bill understand the question but I do not. If you would like to rephrase it with greater detail I would love to take a stab at answering it.
Cheers.
Quote of the moment....
"My job is so top secret even I don't know what I'm doing!"
BillSoo
09-13-2000, 01:46 PM
If it works, why do you need another way?
I suppose you could use API calls like CreateProcessA or even send DDE commands to the WindowsExplorer to launch your program but why bother?
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Derek Stone
09-13-2000, 02:17 PM
Why don't you just shell to your app, which will create a new instane of it, then terminate the first instance?
-cl
CornMaster
09-13-2000, 02:57 PM
All good idea's. But I figured out a way to fix the program so it wouldn't have to restart. Really simple to. It's was very stupid of me to not think of it. I'll explain:
I wrote a program that would write a batch file that would run quake 2 with options that you set in the program. The problem was that if you selected an option and then wanted to change it the program would add the command twice. (ex. +set maxclients 10) This sets the maximum players to ten. If I wanted to change this the program would insert another (+set maxclients 5) statement and mess everything up. So I just added a restart button and it clears the textbox that stores the commands and makes all the frames invisible so you can start from scratch.
The program almost finished. Just need to do more testing but I'll put a link here when it's done.
CornEmpire Board Administrator
<A HREF="http://www.geocities.com/thecornmaster/" target="_new">http://www.geocities.com/thecornmaster/</A>