如何在Python中为Windows hwnd设置透明度键?
我希望使我的wxPython窗口的背景(只有背景)透明 在Windows中,窗体可以有一个透明的背景,这允许用户通过将背景设置为透明键颜色,为Windows提供“透明”背景如何在Python中为Windows hwnd设置透明度键?,python,windows,wxpython,Python,Windows,Wxpython,我希望使我的wxPython窗口的背景(只有背景)透明 在Windows中,窗体可以有一个透明的背景,这允许用户通过将背景设置为透明键颜色,为Windows提供“透明”背景 在wx中似乎没有这样做的选项。考虑到我的窗口的HWND,我如何直接设置它?墨菲定律,我问了之后就找到了答案 Win32 GUI模块具有设置透明度密钥的功能 SetLayeredWindowAttributes(hwnd, Key, Alpha, Flags) Sets the opacity and trans
在wx中似乎没有这样做的选项。考虑到我的窗口的HWND,我如何直接设置它?墨菲定律,我问了之后就找到了答案 Win32 GUI模块具有设置透明度密钥的功能
SetLayeredWindowAttributes(hwnd, Key, Alpha, Flags)
Sets the opacity and transparency color key of a layered window.
Parameters
hwnd : PyHANDLE
handle to the layered window
Key : int
Specifies the color key. Use win32api::RGB to generate value.
Alpha : int
Opacity, in the range 0-255
Flags : int
Combination of win32con.LWA_* values