none
Windows 10 - Application window transparency inconsistencies RRS feed

  • Question

  • We would like to achieve the transparency and mouse pass through behaviors in our Windows applications using the Layered Windows functions of the Windows API. In general our use of Layered windows has worked as expected in accordance with the documentation up until now. In the past we were using Windows 7 to host our Layered window applications with success, however a recent move to Windows 10 has caused the layered windows functionality to stop working. 

    What we are seeing under Windows 10 is that the Layered Window's API call have either: no effect, achieve a temporary transparency, e.g. < 1-5 seconds, mouse pass through not working or working with no transparency and a restricted combinations of colour keys. These inconsistent behaviors in Layered Windows occur across different hardware configurations that functioned as expected when using older Windows OS's and WMWare hosted Windows Virtual Desktops.

    We suspect that the issue may be related to the use of DirectX in our applications and how DirectX resources are managed in DWM and in combination with different hardware, the problem now requires a more informed view.

    Do you have any comments or solutions to the above issue for the use of Layered Windows on Windows 10? Are there any good/relevant knowledge based articles that you can point us to that may have covered this in some detail? Any assistance that you can provide on this issue would be appreciated.

    For completeness, we provide some sample code that shows our use of the Layered Windows API functions (error checking omitted): 

    // Get existing style

     LONG style = ::GetWindowLong(hwnd, GWL_STYLE);

    // Set the layered window extended style

    ::SetWindowLong(m_hWnd, GWL_EXSTYLE, (on ? (currVal | WS_EX_LAYERED) : (currVal & ~WS_EX_LAYERED)));

    // set the colour key for the window. This is the colour of pixels to make both transparent and provide mouse pass through.

    ::SetLayeredWindowAttributes(m_hWnd, RGB_KEY, 0, LWA_COLORKEY);

    Regards,

    Wednesday, August 9, 2017 12:02 PM