Calling SetWindowCompositionAttribute
can indeed add the acrylic effect of Win10 to the window, but I have a problem that I still can't solve, that is, how to realize the rounded window while adding the acrylic effect. As shown in the picture below, even if I use win32guiSetWindowRgn(int(self.winId()),win32gui.CreateRoundRectRgn(0, 0, 500, 500, 500, 500), True)
in pyqt, the acrylic panel cannot be cropped. May I ask Do you have any good ideas?
How to implement rounded corners for window that call SetWindowCompositionAttribute
1k Views Asked by zhiyi At
2
There are 2 best solutions below
0

The SetWindowCompositionAttribute
API is not public. To apply one or more high quality effects to an image or a set of images, you can use Direct2D.
Here are some helpful links for you get started:
How to load an image into Direct2D effects using the FilePicker
And if you still you still want to use SetWindowCompositionAttribute
API, I would suggest that you raise your voice on Feedback Hub.
You can use border-radius to make a workaround (UpdateLayeredWindow is equivalent to WA_TranslucentBackground, SetWindowRgn don' have affect over SetWindowCompositionAttribute blur)
Full code:
UpdateLayeredWindow alpha example: https://github.com/wxWidgets/Phoenix/issues/1544