Adding the "Aero Glass" blur to your Windows 10 apps
Published ยท Last revised(Update: At the time of writing, Fluent had not yet been fully revealed. We now know this to be the start of Acrylic Blur work.)
Since the reintroduction of Aero Glass in Windows 10, I've been receiving questions on how to incorporate that functionality into 3rd party applications. A few nights ago I looked into it and here's my guidance:
-
Abandon code that uses DwmEnableBlurBehindWindow. This function hasn't been deprecated, oddly enough, but is effectively dead on Windows 10. Stop using it. (Also consider abandoning DwmExtendFrameIntoClientArea.)
-
Start using SetWindowCompositionAttribute directly. It's not officially documented but here's the plumbing you need, if you're writing C# utilizing Interop Services tooling:
-
On the view side, you don't need to worry about chroma keys anymore! Simply ensure your window uses a (background) brush with an alpha channel and the compositor will handle the rest.
The sample project I used to create the screenshot above can be found on GitHub.
Have fun!