gpt4 book ai didi

c++ - OwnerDraw 与 WS_EX_COMPOSITED 在 XP 下

转载 作者:太空狗 更新时间:2023-10-29 23:06:43 28 4
gpt4 key购买 nike

我有一个静态控件,它在创建时具有 SS_OWNERDRAWSS_NOTIFY 标志。它的父窗口有 WS_EX_COMPOSITED 标志。

在Windows XP下,绘制不正确,如下图(右上角的矩形):

enter image description here

但在Windows 7下,它是正确绘制的,如下图所示(右上角的“X”):

enter image description here

如何在 XP 中解决这个问题?此外,是什么原因导致此问题(在 XP 中)?

最佳答案

CreateWindowEx() 的 MSDN 是这样说的:

With WS_EX_COMPOSITED set, all descendants of a window get bottom-to-top painting order using double-buffering. Bottom-to-top painting order allows a descendent window to have translucency (alpha) and transparency (color-key) effects, but only if the descendent window also has the WS_EX_TRANSPARENT bit set. Double-buffering allows the window and its descendents to be painted without flicker.

即子 STATIC 控件应该设置 WS_EX_TRANSPARENT

关于c++ - OwnerDraw 与 WS_EX_COMPOSITED 在 XP 下,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14889949/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com