Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Python中为Windows hwnd设置透明度键?_Python_Windows_Wxpython - Fatal编程技术网

如何在Python中为Windows hwnd设置透明度键?

如何在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

我希望使我的wxPython窗口的背景(只有背景)透明

在Windows中,窗体可以有一个透明的背景,这允许用户通过将背景设置为透明键颜色,为Windows提供“透明”背景


在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