IS there anyway to write a program that can run other programs? (like if I wanted to make a menu program, that would run another program depending on which selection they make)
thnxs
IS there anyway to write a program that can run other programs? (like if I wanted to make a menu program, that would run another program depending on which selection they make)
thnxs
FAQ time
Be careful.... this is the most basic of methods and can... probably will lead to unpredictable things.
#include <iostream.h>
#include <stdlib.h>
#include <conio.h>
int main()
{
int killapp = -1;
int choice;
do
{
cout << "1) Notepad\n";
cout << "2) Wordpad\n";
cout << "3) Paint\n";
cout << "4) Quit\n\n";
cin >> choice;
switch(choice)
{
case 1: system("notepad.exe");
break;
case 2: system("Write.EXE");
break;
case 3: system("Pbrush.exe");
break;
case 4: killapp = 0;
break;
default: cout << "Invalid option.";
break;
};
}while(killapp == -1);
cout << "\nReturned without crashing windows.";
return 0;
}
I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P
Thanks! I was lookin at the FAQ, and it mentioned a CreateProcess() command. I looked into it, and it looks like thats what I want, but I can't seem to make it work :-( any help would be appreciated