[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

DWM problem (Vista glass) when setting transparencykey

Posted on 2008-11-12
2
Medium Priority
?
461 Views
Last Modified: 2013-12-17
Please consider the minimum code below. This code creates a simple form with a 100 pixels above margin with vista blur glass effect. (For support purpose, we assume this code will be only executed under Vista)

All works very fine until I set the transparencyKey of this form. If the transparencyKey is set to a non empty value, the blur glass region is painted in black.

My pupose is to "bore a hole" in the form to let see a region of the next application in the z-order.

Thanks in advance for help,

Kind regards,

Guy
public partial class Form1 : Form
    {
        MARGINS glassMarges;
 
        public Form1()
        {
            InitializeComponent();
            glassMarges = new MARGINS(0, 0, 100, 0);
            DwmExtendFrameIntoClientArea(this.Handle, ref glassMarges);
            this.Invalidate();  
        }
 
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.FillRectangle(Brushes.Black, Rectangle.FromLTRB(0, 0,this.ClientRectangle.Width, glassMarges.cyTopHeight));
            base.OnPaint(e);
        }
 
 
        [DllImport("dwmapi.dll", PreserveSig = false)]
        public static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMargins);
        
        [StructLayout(LayoutKind.Sequential)]
        public struct MARGINS
        {
            public int cxLeftWidth, cxRightWidth, cyTopHeight, cyBottomHeight;
 
            public MARGINS(int left, int right, int top, int bottom)
            {
                cxLeftWidth = left; cyTopHeight = top;
                cxRightWidth = right; cyBottomHeight = bottom;
            }
        }
 
    }

Open in new window

0
Comment
Question by:guyvaio
  • 2
2 Comments
 

Author Comment

by:guyvaio
ID: 22995580
No answer. Does it mean "no solution" ?
Is really possible that Microsoft has conceived as "incompatible" the transparency and the blur effect in the .net framework ?
Kind regrads,
Guy
0
 

Accepted Solution

by:
guyvaio earned 0 total points
ID: 23284465
No solution ! Where are the experts ?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month20 days, 10 hours left to enroll

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question