Screen blur alpha effect
-
- Founder/Site Admin
- Posts: 2957
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Screen blur alpha effect
I created a sample for a particular solution.
It will display a messagebox while the entire screen is covered with a blur effect.
It is done by creating a borderless/captionless dialog, maximized including covering the windows taskbar and set to TOPMOST.
On top of this blurred dialog a normal messagebox is displayed.
This emphasizes the importance of the messagebox.
You can play with this solution and make it fit your needs.
Other things to consider is to disable switching to other screens using ALT-TAB for instance.
It looks like this:
The sample can be downloaded here (saved in TD21 text format and works on all TD versions)
https://samples.tdcommunity.net/index.p ... rch_mode=f
It will display a messagebox while the entire screen is covered with a blur effect.
It is done by creating a borderless/captionless dialog, maximized including covering the windows taskbar and set to TOPMOST.
On top of this blurred dialog a normal messagebox is displayed.
This emphasizes the importance of the messagebox.
You can play with this solution and make it fit your needs.
Other things to consider is to disable switching to other screens using ALT-TAB for instance.
It looks like this:
The sample can be downloaded here (saved in TD21 text format and works on all TD versions)
https://samples.tdcommunity.net/index.p ... rch_mode=f
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Re: Alternate way to achieve System Modal dialog box function
Thanks Dave. This really helps me to convince business what I can achieve. I will try to modify the code according to my requirement.
Once again thank you so much.
Once again thank you so much.
-
- Founder/Site Admin
- Posts: 2957
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Re: Alternate way to achieve System Modal dialog box function
I forgot to mention that the sample as intended is only working on Windows 10.
(On Windows 7, the screen will be black and not blurred)
I'm currently changing the sample so it also blurs also on Windows 7.
When ready, I will replace the sample download and report it here.
(On Windows 7, the screen will be black and not blurred)
I'm currently changing the sample so it also blurs also on Windows 7.
When ready, I will replace the sample download and report it here.
Regards,
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Re: Alternate way to achieve System Modal dialog box function
Thank you for the information Dave.
Re: Alternate way to achieve System Modal dialog box function
Dave -- it seems it doesn't work on Win v8.1 either, FYI.
Jeff Luther @ PC Design
Palm Springs, California
Palm Springs, California
-
- Founder/Site Admin
- Posts: 2957
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Re: Alternate way to achieve System Modal dialog box function
Thanks Jeff for this info.
Well, Microsoft isn't making it easy for us.
Some background info:
The blur effect was initially introduced with the function DwmEnableBlurBehindWindow.
(Vista/Windows 7)
But then, on Windows 8 and higher, this function is not working anymore due to the fact that Aero-glass feature was removed.
Instead, on Windows 10, we can use SetWindowCompositionAttribute. This is not (yet) documented on MSDN.
So we need to determine the Windows OS version first to call the correct function.
But in Windows 10, the Windows version API functions have been changed. From TD we can not use the good old
GetVersion
and GetVersionEx
functions anymore.They depend on application manifests, which we can not control in TD.
The Vis function for getting Windows OS version is also broken on older TD versions.
So, I created a fairly safe way to determine the Windows OS version, which I included in the sample.
I have uploaded the changed sample and it works like this:
- Windows 7 -> BLUR effect using
DwmEnableBlurBehindWindow
- Windows 10 -> BLUR effect using
SetWindowCompositionAttribute
- Other OS -> TRANSPARENT ALPHA effect using
SetLayeredWindowAttributes
The ALPHA effect is not a real blur. It will use a semi-transparent effect (ALPHA channel) which grays out the desktop which also has the visual effect that the messagebox stands out.
You can download the sample here:
https://samples.tdcommunity.net/index.p ... rch_mode=f
Regards,
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Re: Screen blur alpha effect
Hello Dave,
if you have two monitors, the second monitor is not locked.
Kind regards
Harald
if you have two monitors, the second monitor is not locked.
Kind regards
Harald
-
- Founder/Site Admin
- Posts: 2957
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Re: Screen blur alpha effect
Yes, good one.
Will add support for multi-monitor setup.
Regards,
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Dave Rabelink

Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Who is online
Users browsing this forum: [Ccbot] and 0 guests