PDA

View Full Version : Shut off DOS screen automatically to Windows



Unregistered
11-06-2001, 06:36 PM
There are two screens(two applications). one is DOS screen, the other is Windows. Dos screen get generated when the some function get called in Windows screen. Then the computer will continue the function in the DOS screen. When the DOS application get finished, it needs to switch to Windows screen again. I could press to Ctrl + C to go back to Windows but I want the DOS screen could automatically shut off when the application in DOS screen get finished.


So is anyone knows how to code to switch DOS screen to Windows screen with press anykey?

Thanks

Hillbillie
11-06-2001, 06:51 PM
Let me get this straight. You want the DOS terminal screen to go away when your program finishes, right?

That's simple. Just make the call to clrscr() the last statement before your return.

Ex.:



int main()
{
...
clrscr();
return 0;
}

frenchfry164
11-08-2001, 07:14 PM
Or does he want the dos window to automatically close? Then use this:


int main()
{
...
system("EXIT");
return 0;
}