SetLayeredWindowAttributes does not work on Windows 7

I use SetLayeredWindowAttributer to make the specific color of a layered window transparent.

This works fine in Windows XP, VISTA. But when I use the same in Windows 7, it does not work.

SetLayeredWindowAttributes(hWnd, RGB(0xff,0xff,0xff), 0, LWA_COLORKEY);

When I use LWA_ALPHA, then it also works. The problem is that I cannot make a certain color transparent in Windows 7.

The following statement works on Windows 7

SetLayeredWindowAttributes(hWnd,RGB(0xff,0xff,0xff), 100, LWA_ALPHA);

Is it possible that the displayed color values ​​do not match the color value in SetLayeredWindowAttributes?

+3
source share
1 answer

0xff, 0xff, 0xff () LWA_COLORKEY. (, 0xff, 0xff, 0xfe).

UpdateLayeredWindowIndirect. , , GDI, Direct2D.

http://msdn.microsoft.com/en-us/magazine/ee819134.aspx

+2

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


All Articles