-
Closing Window in C++
running a program with Turbo C++ 4.5. On menu option to close program, it terminates and displays inactive. Anyone know how I could get C++ to close the Window on termination automatically instead of having to click the x box in the top right of the window. Thanks in advance for suggestions etc...
-
You can try...
You can call this function where you want to exit:
exit(1);
-
Thanks Syntax, will try it as I'm currently trying it with exit(-1);
-
Here's one way.
Code:
#include <windows.h>
.
.
//Put this in main() before return 0
DestroyWindow(GetActiveWindow());
-
Thanks, Swoopy....will give it a try