如何在 MFC 应用程序中最小化任务栏的子对话框?
我从父对话框打开子对话框。在子对话框属性中,我启用了“最小化”属性。但如果单击“最小化”按钮,则子对话框将最小化到屏幕的左下角,而不是 Windows 任务栏。我该如何解决这个问题?
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. How can I solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的子对话框必须具有包含
WS_EX_APPWINDOW
< 的扩展样式/a> (除了是顶级窗口之外)。Your child dialog must have an extended style containing
WS_EX_APPWINDOW
(in addition to being a top-level window).如果我没记错的话,如果您希望“子”对话框出现在任务栏上,则它必须是顶级对话框。
换句话说,当创建子对话框时,将父对话框设置为 NULL 或 GetDesktopWindow()。不过,我想这取决于您的子对话框的创建方式。
如果您包含用于创建子对话框的代码,将会有所帮助。
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(). 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.