-
Hiding Command Prompt
Hi, I just created my own type of start up folder for all of my rendering programs. (ie: rhino Bryce autocad . .etc.) Now to fine tune my program i wanted to know a way to hide or make the command prompt that runs the program not appear. Any help on what command to do this would help. Thank You ;)
-
Sure. You start the whole thing as a Win32 project, not a Win32 console project.
For command line, you pass /subsystem:windows instead of /subsystem:console to the MS linker.
And when you've done that, you need to use WinMain as the startup function instead of main.
Other Windows compilers have something equivalent.
-
Im really new to programming so im a lil confused this is what i have so far. It opens the programs and so does command prompt, could u show me where I have to type the subsystem and winmain? TY
Code:
#include <cstdlib>
int main() \\im guessing this is where i type in the win main
{
system("acad2003.exe");
system("rhino1.exe.exe");
system("bryce01.exe.exe");
return 0;
}
-
Your code would look like this:
Code:
#include <windows.h>
int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
// ShellExecute essentially does the same as system, but you don't need yet another header for it.
ShellExecute(0, 0, "acad2003.exe", 0, 0, SW_SHOW);
ShellExecute(0, 0, "rhino1.exe", 0, 0, SW_SHOW);
ShellExecute(0, 0, "bryce01.exe", 0, 0, SW_SHOW);
return 0;
}
As for the subsystem setting, that's a project/compiler option. What compiler are you using?
-
Im using Dev-C++ and i found the option to do the windows application instead of console project. THanks for yur help. You and all you programming gurus are the best. I dont know why programmers as a whole get a bad rep. THX again!!