Tommy Crews Tommy Crews - 1 year ago 474 Question

Native Aero Blur without Glass Effect on Borderless WPF Window

I am aware that similar questions have been asked and answered. Mine, however, is a three-part question.

For the purposes of this question, keep the following in mind:

  • I am an amateur, early college undergraduate studying Computer Science. I am highly unskilled in complex programming, but I can understand most terminology.

  • This is a WPF project created in Visual Studio using VB.NET, but I can read C# just as easily due to the languages' similarity.

  • This is my first time experimenting with any DWM APIs.

1. Applying Aero Glass to Borderless Window

First and foremost, is it possible to use the glass effect in the background of a borderless window? If so (and I believe it to be), how is this done?

Additionally, since Windows 8 and newer no longer use the translucent glass effect, can this still be done on those operating systems?

2. Keeping Native Blur Effect without Glass

I want the smooth native DWM blur effect, but I don't want the glossy glass overlay, and I don't want the window color predefined in the user's theme settings.

3. Customizing Blur Radius and Location

Is it possible to only apply this effect to a certain portion of the window? More importantly, is it possible to adjust the intensity (radius) of the blurring effect?

EDIT - Screenshot Examples

By request, I have posted some examples of the effect I wish to achieve.

Current Program

The image above is an actual screenshot of my WPF application (still in the works). Its minimalist design relies heavily on animation of movement and window resizing.

Blurred Program

Using some photoshop skills, I've rendered the image above, demonstrating the effect I want to create, exactly the way I want it. Note the following:

  • The blur has a much higher radius (intensity) than usual Aero blurring effects

  • The blur is only visible on one portion of the windows

  • The blur does not inherit its color from the green color theme of the desktop

Tom Tom
Answer Source

1. Applying Aero Glass to Borderless Window

Since what you are trying to achieve is not so much a glass effect but more of a transparent+blur you can use the following methods to blur behind the window.

Windows 7: you can use DwmEnableBlurBehindWindow to blur behind the window.

Window 8: I havn't found a workable solution since DwmEnableBlurBehindWindow was removed in Windows 8.

Windows 10: you can use SetWindowCompositionAttribute to blur behind the window.

2. Keeping Native Blur Effect without Glass

The above solutions will only apply a blur effect behind the window, it will be up to the window to define transparency and colour.

3. Customizing Blur Radius and Location

With these approaches you can only blur underneath the entire window, and it will be up to you to use an alpha channel on portions of the window you want to be transparent. I don't think you can define the blur radius either.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download