Hello there, I make little program's that run in DOS, when you run the *.exe file it opens a DOS window is there some code that I could put in my program's so that when it finishes the window will auto close? Any and all help I thank you for.
Hello there, I make little program's that run in DOS, when you run the *.exe file it opens a DOS window is there some code that I could put in my program's so that when it finishes the window will auto close? Any and all help I thank you for.
()(ôô)()© MonKey ware
Kyle J. R.
do a search at msdn for FreeConsole().
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
I am inclined to say yes, I'm pretty sure that this is an attribute that you can specify when creating a window class, but that means using windows programming to make a DOS-box application. There isn't any -easy- way to do it in the code itself.
Of course, if you call your program through a shortcut, or gdi file, then you could specify in there that you want the program to close on exit.
Callou collei we'll code the way
Of prime numbers and pings!
I think what you're really looking for is the exit() function.
hope this helps.
yep sound like exit() is deffinitely what you're looking for
although be aware that closing a program automatically may not allow the user to see the end results you will have to use a getch(); or run the prog from the prompt
hope this is what your after.
exit will not close the console. just drop out of it to a prompt!
to close the console write a small windows app that uses AllocConsole() to get a DOS console. Do what you want in the console. Then call FreeConsole() to clean up and get rid of the console. Do a search at msdn for console functions for more info.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi