Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blur-behind window with titlebar in Windows 10? Stopped working after Windows Update

I'm trying to create a transparent window with a "glass" effect in Windows 10. This worked until recently:

Screenshot

What I have been doing is:

  • Paint to the target DC including an alpha channel. One way to do this in plain GDI is to construct an image with an alpha channel, and BitBlt it using SRCCOPY to the DC. You can also use the AlphaBlend function.
  • Then I use SetWindowCompositionAttribute (or DwmExtendFrameIntoClientArea) to enable blur behind on windows 10 (or earlier).

This worked until today, and suddenly stopped working after an update - the window is now opaque. I used System Restore and went back one day, and it actually worked again! Any ideas how can I fix this?

like image 200
jdm Avatar asked Sep 01 '15 15:09

jdm


1 Answers

It turns out I was calling SetWindowCompositionAttribute incorrectly. Namely, one of the parameters has a size field, and I was putting the wrong size in. That it used to work at some point was a pure accident.

like image 140
jdm Avatar answered Oct 15 '22 08:10

jdm