pthom / hello_imgui

Hello, Dear ImGui: unleash your creativity in app development and prototyping
https://pthom.github.io/hello_imgui
MIT License
606 stars 91 forks source link

How to Hide the Terminal Window? #25

Closed downloadproject closed 1 year ago

downloadproject commented 1 year ago

How to Hide the Terminal Window?
think you!

pthom commented 1 year ago

https://stackoverflow.com/questions/2753761/how-do-i-tell-cmake-not-to-create-a-console-window https://cmake.org/cmake/help/latest/command/add_executable.html

So I would say (not tested).

  1. Inside your CMakeLists:
hello_imgui_add_app(your_app_name ...)
set_target_properties(your_app_name PROPERTIES WIN32_EXECUTABLE ON)
  1. Change the main() cpp function signature to WinMain:

https://learn.microsoft.com/en-us/windows/win32/learnwin32/winmain--the-application-entry-point

pthom commented 1 year ago

The terminal window is now disabled by default under windows