Hide Terminal program window

Source: Internet
Author: User

#include <iostream>using namespacestd;//I ' m using Vista ATM (It's evil), but GCC comes assuming the worst.//If you haven ' t patched your compiler to agree with the actual version//of the Windows OS, then you'll need to make sure your do it like this.//#if_win32_winnt < 0x0500#undef_win32_winnt#define_win32_winnt 0x0500#endif#include<windows.h>//Here's some fun timer stuff for the user.//(Notice how he won ' t see it//console is hidden, but it'll still work.)voidtimeout () { for(intCntr =3; Cntr >0; cntr--) {cout<<"\ r"<< cntr <<Flush; Sleep ( + ); } cout<<"\ r"<<Flush; }//demonstrate some fun stuff.//Notice How hiding the console window causes it-disappear from//The Windows task bar. If you have want to make it minimize//sw_minimize instead of Sw_hide.//intMain () {cout<<"Preparing to hide the console window\n";  Timeout ();  ShowWindow (Getconsolewindow (), sw_hide); cout<<"Preparing to show the console window\n";  Timeout ();  ShowWindow (Getconsolewindow (), sw_restore); cout<<"All done!\n"; return 0; }

Copy from:http://www.cplusplus.com/forum/beginner/12001/

Hide Terminal program window

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.