Click here to Skip to main content
12,554,442 members (76,071 online)
Click here to Skip to main content


76 bookmarked

Windows Vista Aero Glass in .NET Managed Win32 Applications

, 18 Feb 2007
Demonstrates the basics of using Aero Glass effects within a .NET managed Win32 Forms application.
*	(C) Copyright 2007, Michael Carlisle (
*	All rights reserved.
*	The code and information is provided "as-is" without waranty of any kind,
*	either expresed or implied.
*	History:
*		18/02/2007	Michael Carlisle				Version 1.0
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Drawing;

namespace CodeKing.Native
    public static class Win32
        /// <summary>
        /// The struct used to pass the Glass margins to the Win32 API
        /// </summary>
        public struct MARGINS
            public int Left;
            public int Right;
            public int Top;
            public int Bottom;
        /// <summary>
        /// The API used to extend the GLass margins into the client area
        /// </summary>
        [DllImport("dwmapi.dll", PreserveSig = false)]
        public static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins);

        /// <summary>
        /// Determins whether the Desktop Windows Manager is enabled
        /// and can therefore display Aero 
        /// </summary>
        [DllImport("dwmapi.dll", PreserveSig = false)]
        public static extern bool DwmIsCompositionEnabled();

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

United Kingdom United Kingdom
Mike Carlisle - Technical Architect with over 20 years experience in a wide range of technologies.


You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161021.1 | Last Updated 18 Feb 2007
Article Copyright 2007 by TheCodeKing
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid