I want to make the window partially transparent, that is, make the window transparent in the area where there is no drawing, but I have failed after many attempts, including using SetLayeredWindowAttributes and UpdateLayeredWindow.
SetLayeredWindowAttributes can only make the specified color transparent, such as black, but this will affect my other normally drawn black parts;
UpdateLayeredWindow should be more suitable, but I did not get any effect when I used it in the on_paint of the view;
Maybe UpdateLayeredWindow has some usage restrictions, such as it cannot be applied to child windows, and the WM_PAINT event cannot be responded to; I don’t know if I should use UpdateLayeredWindow in the parent window, but if it is used in the parent window, the content drawn by the view needs to be passed to the parent window, which may cause a lot of code modifications;
I want to make the window partially transparent, that is, make the window transparent in the area where there is no drawing, but I have failed after many attempts, including using SetLayeredWindowAttributes and UpdateLayeredWindow.
SetLayeredWindowAttributes can only make the specified color transparent, such as black, but this will affect my other normally drawn black parts;
UpdateLayeredWindow should be more suitable, but I did not get any effect when I used it in the on_paint of the view;
Maybe UpdateLayeredWindow has some usage restrictions, such as it cannot be applied to child windows, and the WM_PAINT event cannot be responded to; I don’t know if I should use UpdateLayeredWindow in the parent window, but if it is used in the parent window, the content drawn by the view needs to be passed to the parent window, which may cause a lot of code modifications;
Is there any good way to achieve this effect?