如何隐藏一个win32应用程序窗口? [英] How does one hide a win32 app window?

查看:575
本文介绍了如何隐藏一个win32应用程序窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案

我想通过传递参数以静默模式运行应用程序,否则我会显示窗口。 ShowWindow(... SW_HIDE ...)不起作用?



em>首先不创建窗口。没有什么强迫你在InitInstance中实际创建一个窗口。虽然如果你正在使用MFC,很可能你的应用程序/域/业务逻辑位于那里,紧密耦合到那些MFC消息处理程序等等。在这种情况下,窗口将需要存在。


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

解决方案

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.

这篇关于如何隐藏一个win32应用程序窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆