我这边怎么没用,我这样把子窗口设置成透明后,子窗口还是遮住父窗口了。子窗口还是白色背景[/quote]
LWA_ALPHA这种方式的透明,只要不为0,子窗体肯定会遮住下面的父窗体,可是这不影响看父窗体的视频啊,父窗体的内容是可见的。不明白,你那什么意思[/quote]
我这边完全遮住了父窗口,没有透明效果。父窗口上的东西都看不见了[/quote]
1、看一下调用SetLayeredWindowAttributes时窗口句柄是否正确
2、看一下你子窗体的风格中是否包含WS_EX_LAYERED,如果不设置的话,是无法透明的。
引用MSDN:SetLayeredWindowAttributes的第一个参数
hwnd
[in] Handle to the layered window. A layered window is created by specifying WS_EX_LAYERED when creating the window with the CreateWindowEx function or by setting WS_EX_LAYERED via SetWindowLong after the window has been created.
[/quote]
上面两行代码设置了相应属性吧?用GetSafeHwnd()的到的窗口句柄怎么会不正确呢?
重新创建一个窗体,设置透明度,覆盖在视频界面上[/quote]
我这边怎么没用,我这样把子窗口设置成透明后,子窗口还是遮住父窗口了。子窗口还是白色背景[/quote]
LWA_ALPHA这种方式的透明,只要不为0,子窗体肯定会遮住下面的父窗体,可是这不影响看父窗体的视频啊,父窗体的内容是可见的。不明白,你那什么意思[/quote]
我这边完全遮住了父窗口,没有透明效果。父窗口上的东西都看不见了[/quote]
1、看一下调用SetLayeredWindowAttributes时窗口句柄是否正确
2、看一下你子窗体的风格中是否包含WS_EX_LAYERED,如果不设置的话,是无法透明的。
引用MSDN:SetLayeredWindowAttributes的第一个参数
hwnd
[in] Handle to the layered window. A layered window is created by specifying WS_EX_LAYERED when creating the window with the CreateWindowEx function or by setting WS_EX_LAYERED via SetWindowLong after the window has been created.