I have a window and then I create a child window using the following code:
HWND childHwnd = CreateWindowExA(WS_EX_LAYERED, "Test", "Test", WS_CHILD, 0, 0, 500, 500, mainHwnd, NULL, instance, NULL);
After it has been created I can control the opacity using:
static COLORREF color = RGB(255, 0, 0);
SetLayeredWindowAttributes(childHwnd, color, 127, LWA_ALPHA);
It works fine but I also have to support Windows 7 and MSDN says the following:
Windows 8: The WS_EX_LAYERED style is supported for top-level windows and child windows. Previous Windows versions support WS_EX_LAYERED only for top-level windows.
I have installed Windows 7 in a VM and sadly it doesn't works. What could be the workaround to achieve the same opacity control over a child window in Windows 7?
I also tried to make it a standalone window and just follow the position of the parent window but the user experience is not that good when the window gets moved fast.