简体   繁体   English

如何最小化MFC应用程序中任务栏的子对话框?

[英]How can I minimize a child dialog to the task bar in an MFC application?

I open a child dialog from a parent dialog. 我从父对话框中打开一个子对话框。 Among the child dialog properties I enabled the "Minimize" property. 在子对话框属性中,我启用了“最小化”属性。 But if click the "Minimize" button, then the child dialog minimizes to the left corner of the screen instead of the Windows task bar. 但是,如果单击“最小化”按钮,则子对话框将最小化到屏幕的左角而不是Windows任务栏。 How can I solve this? 我该如何解决?

您的子对话框必须具有包含WS_EX_APPWINDOW的扩展样式(除了是顶级窗口之外)。

If I remember correctly, the "child" dialog has to be a top-level dialog if you want it to have a presence on the taskbar. 如果我没记错的话,如果您希望它在任务栏上存在,则“子”对话框必须是顶层对话框。

In other words, when creating your child dialog set the parent to NULL or to GetDesktopWindow(). 换句话说,在创建子对话框时,将父对话框设置为NULL或GetDesktopWindow()。 I guess it depends on how your child dialog is being created, though. 我想这取决于您的子对话框的创建方式。

It would help if you included the code you're using to create the child dialog. 如果您包含了用于创建子对话框的代码,这将有所帮助。

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

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