This is done by interacting with the Vista DWM (Desktop Window Manager) API.
For example, import these functions:
[DllImport("dwmapi.dll")]
static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMargins);
[StructLayout(LayoutKind.Sequential)]
struct Margins
{
public int cxLeftWidth;
public int cxRightWidth;
public int cyTopHeight;
public int cyBottomHeight;
}
Then you can use this to “pull” the glass from the top of the window down to the client area:
GlassMargins.Top = 40;
GlassMargins.Left = 0;
GlassMargins.Right = 0;
GlassMargins.Bottom = 0;
DwmExtendFrameIntoClientArea(this.Handle, ref GlassMargins);
Here you can go ahead and do other things, such as draw text or images on glass, or place controls on it, such as an Office 2007-style application button.
source
share