How does one hide a win32 app window?

后端 未结 5 1487
不知归路
不知归路 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:23

    ShowWindow(... SW_HIDE ...) doesn't work?

    The best practice here is to not create the window in the first place. Nothing forces you to actually create a window in InitInstance. Though if you're working with MFC it's likely a lot of your application/domain/business logic is sitting there, tightly coupled to those MFC message handlers and so forth. In which case the window will need to exist.

提交回复
热议问题