在C ++中将对话框置于其他对话框的前面 [英] Bring the dialog to front of the other in C++

查看:93
本文介绍了在C ++中将对话框置于其他对话框的前面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我希望对话框始终位于某个窗口的前面.
隐藏窗口时,对话框也必须隐藏.
显示窗口时,必须显示对话框.
而且对话框也必须是无模式的.
我该如何解决这个问题?
帮帮我.

Hi I want the dialog box to be always in front of a certain window.
When the window is hidden, the dialog must be hidden too.
When the window is shown, the dialog must be shown.
And also the dialog must be modeless.
How can I solve this problem?
Help me.

Thanks in advice.

推荐答案

假定pdg是在其他地方创建的无模式对话框,请使用以下代码.

Assuming pdg is a modeless dialog box created elsewhere, use the following code.

void CMyWnd::OnSize(UINT nType, int cx, int cy)
{
    baseclass::OnSize(nType, cx, cy);
    switch(nType)
    {
    case SIZE_MAXHIDE:
    case SIZE_MINIMIZED:
        pdg->ShowWindow(SW_HIDE);
        break;
    default:
        pdg->ShowWindow(SW_SHOW);
        pdg->BringWindowToTop();
        break;
    }
}


这篇关于在C ++中将对话框置于其他对话框的前面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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