I'm using the MS Visual Studio C++ Express IDE, and I want to make a button so when you click it it will execute different commands inside the command line.
For example, if you wanted to change the system appearance you could type 'Control color' in the cmd, but how would I do that from C++?
I'm making a console application. So far I've managed for it to say 'Hello, World!'. Here's the entire code.
If you're referring to executing console commands, you already did! :P
You used system("PAUSE"); which sends the pause command to the os. the same applies for color, or any other possible console command in the world ever. so system("COLOR FA") will change the color to whatever FA stands for.
Though, it is necessary to warn you against using calls to system(). Its a pretty nasty function, and unless you're using it for yourself only, it shouldn't be used. Its completely platform-dependent, and halts your program, calls the os, waits for the os to answer, then starts your program back up. Also, anything it runs, say you call system("start notepad.exe"), has the same privileges as the account your on. If a virus is embedded in your notepad and you're on an admin account, that virus was just ran with administrator privs.
Ah. I see! Is there a more safe way to load up things?
Like if I had "system("cmd.exe");" could I make that a little less nasty?
Also, I've figured out how to close the program on button click (this->Close();), but this->Minimize(); doesn't want to work. Is there a way to minimize it?