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

后端 未结 7 797
时光取名叫无心
时光取名叫无心 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:52

    Weaker preconditions:

    If your program does not have console child processes, simply FreeConsole(); should do it.

    Else

    a (hidden) window is required in order to not have console popups from child processes, i.e. as mentioned above

    ShowWindow (GetConsoleWindow(), SW_HIDE);

提交回复
热议问题