I dont want console to appear when i run c++ program

后端 未结 7 794
时光取名叫无心
时光取名叫无心 2021-02-07 11:24

I want to write one c++ program, compiling and linking .cpp gives .exe file. if i double click on that and execute it a console gets opened and closed. I don\'t want that consol

7条回答
  •  忘了有多久
    2021-02-07 11:45

    If you can't move to a Window application (I mean with GUI) because sometimes you may need to use the console for output you can use following code to hide the console window:

    HWND hWnd = GetConsoleWindow();
    ShowWindow(hWnd, SW_HIDE);
    

提交回复
热议问题