Prev: Windows Defender and Microsoft Security Essentials
Next: Managed/unmanaged code exceptions handling tool (C# / С++)
From: MilesAhead on 21 Mar 2010 16:03 All the example code using DwmEnableBlurBehindWindow has the region in the DWM_BLURBEHIND structure set to 0 to blur the whole window. The only code I can find otherwise is in C++ and doesn't translate. Anyone have a c# example where only part of the window is blurred? I've tried everything I can think of to create a rectangular region inside the form but I can't stumble on the trick to assign it to the hRgnBlur field of the structure. It wants an IntPtr to this region but I've never seen an example how to get this except using C++ classes that don't exist in c#. -- MilesAhead "*Mor*ons think they'll get smarter by taking *less*ons." - MilesAhead :: ::
From: Patrice on 23 Mar 2010 11:02 Hello, > ...but I can't stumble on the trick to assign it to the > hRgnBlur field of the structure. Have you tried to use the Region class and then http://msdn.microsoft.com/en-us/library/system.drawing.region.gethrgn.aspx to get its handle ? -- Patrice
From: MilesAhead on 23 Mar 2010 13:31
Patrice;1245036 Wrote: > Hello, > > > > > > > ...but I can't stumble on the trick to assign it to the > > > hRgnBlur field of the structure. > > Have you tried to use the Region class and then > 'Region.GetHrgn Method (System.Drawing)' > (http://msdn.microsoft.com/en-us/library/system.drawing.region.gethrgn.aspx) > to get its handle ? > > > -- > Patrice Thanks. I couldn't find how to use that method. I ended up using the Invoke methods. I was able to set blur behind for only a portion of the form, but it didn't help. If you have a button or control on the form, even if it is out of the blur region, its appearance is still distorted. I guess there's no shortcut. One has to do the drawing of everything or use a graphic image. -- MilesAhead "How come we don't know the I.Q. of the guy who invented the test?" - MilesAhead :: :: |