How can I make only part of the window transparent? (WIN32)

How can I do, for example, only the rectangle inside the window has an opacity like 50% or something like that, and for this part the effect is WS_EX_TRANSPARENT, so that the mouse clicks go through this?

+3
source share
3 answers

I don’t think it’s possible to simply set WS_EX_TRANSPARENT, but it can be done using two windows, create a window with a hole using SetWindowRgn , and another transparent window is added inside this hole using the styles WS_EX_LAYERED and WS_EX_TRANSPARENT.

+3
source

SetLayeredWindowAttributes Win32.

.

+2

Source: https://habr.com/ru/post/1712836/


All Articles