禁用桌面合成会导致选项卡控件闪烁 [英] Disabling desktop composition causes flickering on Tab Control

查看:26
本文介绍了禁用桌面合成会导致选项卡控件闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我禁用桌面合成时,每当我将鼠标悬停在选项卡上时,我都会闪烁/闪烁.这仅在禁用桌面合成时发生.我试图取消 WM_ERASEBKGND 消息,但它不能解决问题.这个问题的解决方法是什么?

这是我尝试用于 MASM 选项卡控件的示例.

将 Listview 类型更改为 Report 以外的类型并绘制框架

删除 WS_EX_COMPOSITED 标志修复了问题,但闪烁又回来了

解决方案

通过在对话框扩展样式中使用 WS_EX_COMPOSITED 解决了问题.

修复我的问题的编辑方法是在 Listview 上使用 SetParent 并将其附加到主窗口,因为它是父窗口而不是子对话框.现在它正确显示了它的框架.

所以我觉得这个有问题

另一个对话框上的列表视图 -> 使用 CreateDialogParam 将其附加到主对话框(通过选项卡控件).WS_EX_COMPOSITED 设置在选项卡控件上

结果:有 XP 绘图问题.非常迟钝.报表类型中列表视图的隐藏框架.如问题编辑所示.

新方法另一个对话框上的列表视图 -> 使用 CreateDialogParam 将其附加到主对话框(通过选项卡控件).WS_EX_COMPOSITED 也设置在选项卡控件和主对话框上.调用 SetParent 将列表视图与主对话框关联,因为它是父对话框.

结果:画得很流畅.XP也没有问题.即使禁用桌面合成也不会闪烁.并保留 WM_ERASEBKGND 作为主对话框的默认值,并且没有自定义 WM_PRINT 处理.但是WM_ERASEBKGND只需要在子对话框DialogProc上禁用即可将return设置为1.

When i disable desktop composition i get flickering/blinking whenever i hover the mouse over the tabs. This only happens when desktop composition is disabled. I have tried to cancel WM_ERASEBKGND message but it doesn't fix the problem. What is the solution to this problem?

This is the example that i tried to use for MASM tab control.

http://www.dreamincode.net/forums/index.php?app=core&module=attach&section=attach&attach_id=28600

The bin is already compiled.

EDIT: After enabling the WS_EX_COMPOSITED flag and added a listview control the frames of listview is not drawn. This only happens if ListView type is set to report.

Pic about the issue:

Changing Listview type to other than Report and frames are drawn

Removing WS_EX_COMPOSITED flag fixes the issue but the flickering comes back

解决方案

Issue is fixed by using WS_EX_COMPOSITED in the Dialog box Extended styles.

EDIT: Fixes for the edit of my question is by using SetParent on the Listview and attach it to the main window as it's parent instead of the sub dialog. Now it shows its frame correctly.

So i think this one has an issue

Listview on another dialog -> attach it to the main dialog(Over tab control) using CreateDialogParam. WS_EX_COMPOSITED set on tab control

Result: has XP drawing issues. Very sluggish. Hidden frames of listview in report type. as seen in question edit.

New method Listview on another dialog -> attach it to the main dialog(Over tab control) using CreateDialogParam. WS_EX_COMPOSITED set on tab control and main dialog as well. Call SetParent associate the listview with Main dialog as it's parent.

Result: Very smooth drawing. XP has no issues either. No flickering at all even when disabling desktop composition. And leave WM_ERASEBKGND as default for main dialog and no custom WM_PRINT handling. But WM_ERASEBKGND disabling is only needed on the sub dialog DialogProc to set return to 1.

这篇关于禁用桌面合成会导致选项卡控件闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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