禁用对话框上的航空淡入效果

发布于 2024-09-26 14:55:32 字数 142 浏览 5 评论 0原文

我有一个用 MFC 创建的模式对话框。当它出现时,Aero 主题会淡入过渡以出现新窗口。在我的特殊情况下,我会立即从一个对话框切换到另一个对话框,并且淡入淡出效果会分散注意力。有没有办法可以禁用它,以便立即显示窗口,就像禁用 Aero 时一样,但又不完全关闭 Aero?

I have a modal dialog I'm creating with MFC. When it appears, the Aero theme does it's fade-in transition for a new window appearing. In my particular case I'm switching immediately from one dialog to another and the fade effect is distracting. Is there a way it can be disabled so the window immediately appears, like it does when Aero is disabled, but without switching Aero off completely?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫轩蝶泪 2024-10-03 14:55:33

DwmSetWindowAttribute 函数也许可以帮助你。它允许您修改许多与 DWM 相关的窗口属性。特别是,DWMWA_TRANSITIONS_FORCEDISABLED 属性提到“启用或强制禁用 DWM 转换”,这可能会起作用。

HRESULT hr = S_OK;
LPCVOID dwAttribute  = (LPCVOID)TRUE;

hr = DwmSetWindowAttribute(hWnd, DWMWA_TRANSITIONS_FORCEDISABLED, 
        &dwAttribute, sizeof(dwAttribute));

if (SUCCEEDED(hr))
{
   // The transitions should have been disabled
}

The DwmSetWindowAttribute function might be able to help you. It lets you modify a number of window attributes related to the DWM. In particular, the DWMWA_TRANSITIONS_FORCEDISABLED attribute mentions "Enable or forcibly disable DWM transitions", which just might do the trick.

HRESULT hr = S_OK;
LPCVOID dwAttribute  = (LPCVOID)TRUE;

hr = DwmSetWindowAttribute(hWnd, DWMWA_TRANSITIONS_FORCEDISABLED, 
        &dwAttribute, sizeof(dwAttribute));

if (SUCCEEDED(hr))
{
   // The transitions should have been disabled
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文