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

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

问题描述

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

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?

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

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

bin已被编译.

启用 WS_EX_COMPOSITED 标志并添加列表视图控件后,未绘制列表视图的框架.仅当ListView类型设置为报告时,才会发生这种情况.

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:

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

Changing Listview type to other than Report and frames are drawn

删除 WS_EX_COMPOSITED 标志可解决此问题,但闪烁现象又回来了

Removing WS_EX_COMPOSITED flag fixes the issue but the flickering comes back

推荐答案

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

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

解决问题的方法是在Listview上使用 SetParent ,并将其作为父级而不是子对话框附加到主窗口.现在,它可以正确显示其框架.

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.

所以我认为这个有问题

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

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

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

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

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

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.

结果: 非常平滑的绘图. XP也没有问题.即使禁用桌面合成,也没有任何闪烁.并将 WM_ERASEBKGND 保留为主对话框的默认设置,并且不进行自定义 WM_PRINT 处理.但是只需要在子对话框DialogProc上禁用 WM_ERASEBKGND 以将return设置为1.

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天全站免登陆