WS_EX_LAYERED窗口样式的Adobe Air [英] Adobe Air with WS_EX_LAYERED window style
问题描述
我正在尝试在外部Adobe Air应用程序上设置WS_EX_LAYERED扩展窗口样式.如果您想知道原因,请看到此问题. 我面临的问题是,一旦设置样式,窗口就会停止渲染.这是我的代码:
I am trying to set the WS_EX_LAYERED extended window style on an external Adobe Air application. See this question if you want to know why. The problem I am facing is that as soon as I set the style, the window stops rendering. Here's the my code:
auto style = GetWindowLong(hwnd, GWL_EXSTYLE);
SetWindowLong(hwnd, GWL_EXSTYLE, style | WS_EX_LAYERED);
// If I skip the next line, the window is suddenly white.
// With the next line, the image in the window freezes.
SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA);
窗口继续正常运行(单击等),只是不再重绘(例如,调整大小时).
窗口不具有CS_OWNDC
或CS_CLASSDC
样式.
The window continues to work perfectly fine (clicks etc.), it just doesn't get redrawn anymore (f.e. when resized).
The window does not have the CS_OWNDC
or CS_CLASSDC
style.
谁能告诉我原因是什么?
Can anyone tell me what the reason could be?
推荐答案
您在应用程序描述符文件中设置的呈现方式是什么?我可以想象,除非您将其专门设置为通过CPU渲染,即让AIR使用GDI函数显示内容,否则您的方法将行不通.我认为默认情况下可能使用GPU加速,因此通过SetWindowLong设置样式可能会对此产生干扰.
What's your render mode set to in the application descriptor file? I would imagine your approach wouldn't work unless you specifically set this to render via the CPU i.e. to make AIR use GDI functions to display the content. I think by default it's likely to be using GPU acceleration so setting the style via SetWindowLong may then interfere with this..
如果您不确定如何更改渲染模式:
In case you're not sure how to change the render mode:
- 找到应用程序的已安装文件夹(在程序文件(x86)"下)
- 输入"META-INF \ AIR"子文件夹
- 编辑"application.xml"文件
- 在"initialWindow"部分中查找"renderMode"(如果不存在,则将其添加..)并将其设置为"cpu"
- 保存此内容,然后重新启动AIR应用程序
请参见 AIR描述符文件信息
这篇关于WS_EX_LAYERED窗口样式的Adobe Air的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!