Ejemplo n.º 1
0
 private void CheckAeroEnabled()
 {
     if (Environment.OSVersion.Version.Major >= 6)
     {
         int enabled  = 0;
         int response = WIN32APIMethods.DwmIsCompositionEnabled(ref enabled);
         aeroEnabled = (enabled == 1) ? true : false;
     }
     else
     {
         aeroEnabled = false;
     }
 }
Ejemplo n.º 2
0
 protected override void WndProc(ref Message m)
 {
     switch (m.Msg)
     {
     case WIN32APIConstants.WM_NCPAINT:
         if (aeroEnabled)
         {
             var var = 2;
             WIN32APIMethods.DwmSetWindowAttribute(Handle, 2, ref var, 4);
             MARGINS margins = new MARGINS()
             {
                 bottomHeight = 1,
                 leftWidth    = 1,
                 rightWidth   = 1,
                 topHeight    = 1
             };
             WIN32APIMethods.DwmExtendFrameIntoClientArea(Handle, ref margins);
         }
         break;
     }
     base.WndProc(ref m);
 }