How does one hide a win32 app window?

后端 未结 5 1511
不知归路
不知归路 2020-12-19 09:48

I want to run the app in silent mode by passing in a parameter, otherwise I will show the window.

5条回答
  •  别那么骄傲
    2020-12-19 10:05

    Well, for one you could just decide not to create a window at all if this parameter is passed in, otherwise you can try calling ShowWindow, with the handle to your window and with the SW_HIDE parameter, and see if that does what you need.

    Another way of hiding the window and never having it show up, but still create it, is to chose to never call ShowWindow with SW_HIDE on it, and create it with CreateWindow/CreateWindowEx, and not set the WS_VISIBLE flag in the dwStyle parameter.

提交回复
热议问题