简体   繁体   English

如何在OnInitDialog函数中最小化MFC应用程序?

[英]How to minimize a MFC application in the OnInitDialog function?

I need my MFC application to minimize on start up. 我需要MFC应用程序以最小化启动时间。 I do not have much experience with MFC. 我没有使用MFC的丰富经验。

So far I have tried: removing WS_VISIBLE , calling ShowWindow(SW_HIDE) , and using OnSize(...) . 到目前为止,我已经尝试过:删除WS_VISIBLE ,调用ShowWindow(SW_HIDE) ,并使用OnSize(...) Each one failed to work and/or causes the application to crash. 每个程序均无法工作和/或导致应用程序崩溃。

My next idea is to use the PostMessage function but I'm unsure as to what the parameters would be. 我的下一个想法是使用PostMessage函数,但是我不确定参数是什么。

Can someone show me the parameters to minimize my application using the PostMessage function or give me another option. 有人可以使用PostMessage函数向我显示参数以最小化我的应用程序,还是可以给我另一个选择。

发布带有SC_MINIMIZE参数的WM_SYSCOMMAND消息。

PostMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM