Hi! I'm writting a C++ MS-DOS application that has nothing to output on screen, but still there is a window that opens and closes after a very short time. How can I make it run in the background? 10x..
Hi! I'm writting a C++ MS-DOS application that has nothing to output on screen, but still there is a window that opens and closes after a very short time. How can I make it run in the background? 10x..
Look up Windows Application programming to see how to set up an application w/o a window. If you want closs platform look up libSDL and it will make it really easy to set up windowless applications
Replace your main function with:
And #include <windows.h> at the top.Code:int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
You don't have to worry about the crazy parameters and stuff but it's worth noting that lpCmdLine is a string containing the command line parameters passed to the program. Sadly there's no argc and argv for Windows programming.
You also need to tell the compiler that it's a Windows program so that it won't be looking for a main() function.