A customer wrote a program that calls DwmExtendFrameIntoClientArea
to extend the frame over the entire client area, but then discovered that this made programming difficult:
I have a window which I want to have a glassy border but an opaque body. I made my entire window transparent by calling
DwmExtendFrameIntoClientArea
, and I understand that this means that I am now responsible for managing the alpha channel when drawing so that the body of my window remains opaque while the glassy border is transparent. Since most GDI functions are not alpha-aware, this management is frustrating. Is there a better way? In pictures, I only want the red portion of the diagram below to be on glass; the inside yellow part should be opaque like normal. Is there an API that can do this?
This customer’s excitement about the glass frame is like somebody who buys a pallet of tangerine juice even though he only wanted two glasses. And now he has questions about how to store the rest of the tangerine juice he didn’t want.
This customer, it appears, passed −1 as the MARGINS
to DwmExtendFrameIntoClientArea
which means “Bring it on, baby! Give me all tangerine all the time everywhere!” If you only want the glass to extend into part of your client area, then say so. Set the MARGINS
to the thickness of the glass border (the thickness of the red portion of the above diagram).
0 comments