Valhalla Legends Forums Archive | C/C++ Programming | [C++] Running without a console

AuthorMessageTime
CupHead
If I had a program that was designed to perform a specific task (i.e. Generate a massive text file) that I want to run background without a window being displayed, how would I go about doing so?
October 14, 2003, 2:02 PM
K
Assuming that you're dealing with windows, Compile under the windows subsystem instead of console so a console isn't automatically allocated for you. Or perhaps something like:
[code]
#define _WIN32_WINNT 0x0500
#include <windows.h>

int main()
{
   // show output
   // ...
   ShowWindow(GetConsoleWindow(), SW_HIDE);
   // begin processing...
   // ...
   // finished, show results:
   ShowWindow(GetConsoleWindow(), SW_SHOW);

   return 0;
}
[/code]
October 14, 2003, 5:36 PM

Search