Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Glass Effect in XP using dwmapi.dll

Glass Effect in XP using dwmapi.dll

Scheduled Pinned Locked Moved C#
graphicsgame-devdebugginghelpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Viswa Teja
    wrote on last edited by
    #1

    hii I am desining a form that has glass effect. Well this code works on vista but i need it on Xp. The i am using gets an error saying that "DllNotFound Exception was unhandled". Well I have copyied all the dll that reqired for glass effect from vista. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.DirectX.AudioVideoPlayback; using System.Diagnostics; using System.Drawing.Drawing2D; namespace welcome_page { public partial class Form2 : Form { public Form2() { InitializeComponent(); this.FitGlass(); } Video video; private welcome_page.VistaGlassEffect.VistaApi.Margins marg; private Rectangle topRect = Rectangle.Empty; private Rectangle botRect = Rectangle.Empty; private Rectangle lefRect = Rectangle.Empty; private Rectangle rigRect = Rectangle.Empty; private void FitGlass() { // If DWM is not enabled then get out if (!this.IsGlassEnabled()) { return; } // Set the Margins to their default values marg.Top = 600; // extend from the top marg.Left = 400; // not used in this sample but could be marg.Right = 200; // not used in this sample but could be marg.Bottom = 860;// not used in this sample but could be this.Paint += new PaintEventHandler(this.Form1_Paint); // call the function that gives us glass, // passing a reference to our inset Margins welcome_page.VistaGlassEffect.VistaApi.DwmExtendFrameIntoClientArea(this.Handle, ref marg); } private void apply() { this.Paint -= new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); this.RecreateHandle(); //needed if changing on the fly this.FitGlass(); } private bool IsGlassEnabled() { //if (Environment.OSVersion.Version.Major < 6) //{ // Debug.WriteLine("How about trying this on Vista?"); // return false; //} //Check if DWM is enabled bool isGlassSupported = false; welcome_page.VistaGlassEffect.VistaApi.DwmIsCompositionEnabled(ref isGlassSupported); return isGlassSupported; } // Alpha-blending Paint after the glass extension //

    G P T 3 Replies Last reply
    0
    • V Viswa Teja

      hii I am desining a form that has glass effect. Well this code works on vista but i need it on Xp. The i am using gets an error saying that "DllNotFound Exception was unhandled". Well I have copyied all the dll that reqired for glass effect from vista. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.DirectX.AudioVideoPlayback; using System.Diagnostics; using System.Drawing.Drawing2D; namespace welcome_page { public partial class Form2 : Form { public Form2() { InitializeComponent(); this.FitGlass(); } Video video; private welcome_page.VistaGlassEffect.VistaApi.Margins marg; private Rectangle topRect = Rectangle.Empty; private Rectangle botRect = Rectangle.Empty; private Rectangle lefRect = Rectangle.Empty; private Rectangle rigRect = Rectangle.Empty; private void FitGlass() { // If DWM is not enabled then get out if (!this.IsGlassEnabled()) { return; } // Set the Margins to their default values marg.Top = 600; // extend from the top marg.Left = 400; // not used in this sample but could be marg.Right = 200; // not used in this sample but could be marg.Bottom = 860;// not used in this sample but could be this.Paint += new PaintEventHandler(this.Form1_Paint); // call the function that gives us glass, // passing a reference to our inset Margins welcome_page.VistaGlassEffect.VistaApi.DwmExtendFrameIntoClientArea(this.Handle, ref marg); } private void apply() { this.Paint -= new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); this.RecreateHandle(); //needed if changing on the fly this.FitGlass(); } private bool IsGlassEnabled() { //if (Environment.OSVersion.Version.Major < 6) //{ // Debug.WriteLine("How about trying this on Vista?"); // return false; //} //Check if DWM is enabled bool isGlassSupported = false; welcome_page.VistaGlassEffect.VistaApi.DwmIsCompositionEnabled(ref isGlassSupported); return isGlassSupported; } // Alpha-blending Paint after the glass extension //

      G Offline
      G Offline
      Ghydo
      wrote on last edited by
      #2

      Windows XP does not support glass effect, it's Vista only.

      1 Reply Last reply
      0
      • V Viswa Teja

        hii I am desining a form that has glass effect. Well this code works on vista but i need it on Xp. The i am using gets an error saying that "DllNotFound Exception was unhandled". Well I have copyied all the dll that reqired for glass effect from vista. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.DirectX.AudioVideoPlayback; using System.Diagnostics; using System.Drawing.Drawing2D; namespace welcome_page { public partial class Form2 : Form { public Form2() { InitializeComponent(); this.FitGlass(); } Video video; private welcome_page.VistaGlassEffect.VistaApi.Margins marg; private Rectangle topRect = Rectangle.Empty; private Rectangle botRect = Rectangle.Empty; private Rectangle lefRect = Rectangle.Empty; private Rectangle rigRect = Rectangle.Empty; private void FitGlass() { // If DWM is not enabled then get out if (!this.IsGlassEnabled()) { return; } // Set the Margins to their default values marg.Top = 600; // extend from the top marg.Left = 400; // not used in this sample but could be marg.Right = 200; // not used in this sample but could be marg.Bottom = 860;// not used in this sample but could be this.Paint += new PaintEventHandler(this.Form1_Paint); // call the function that gives us glass, // passing a reference to our inset Margins welcome_page.VistaGlassEffect.VistaApi.DwmExtendFrameIntoClientArea(this.Handle, ref marg); } private void apply() { this.Paint -= new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); this.RecreateHandle(); //needed if changing on the fly this.FitGlass(); } private bool IsGlassEnabled() { //if (Environment.OSVersion.Version.Major < 6) //{ // Debug.WriteLine("How about trying this on Vista?"); // return false; //} //Check if DWM is enabled bool isGlassSupported = false; welcome_page.VistaGlassEffect.VistaApi.DwmIsCompositionEnabled(ref isGlassSupported); return isGlassSupported; } // Alpha-blending Paint after the glass extension //

        P Offline
        P Offline
        padmanabhan N
        wrote on last edited by
        #3

        Viswa Teja wrote:

        Reply Me fast please

        I think understanding your post itself a time consuming one instead how can you expect a fast reply...

        Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

        1 Reply Last reply
        0
        • V Viswa Teja

          hii I am desining a form that has glass effect. Well this code works on vista but i need it on Xp. The i am using gets an error saying that "DllNotFound Exception was unhandled". Well I have copyied all the dll that reqired for glass effect from vista. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.DirectX.AudioVideoPlayback; using System.Diagnostics; using System.Drawing.Drawing2D; namespace welcome_page { public partial class Form2 : Form { public Form2() { InitializeComponent(); this.FitGlass(); } Video video; private welcome_page.VistaGlassEffect.VistaApi.Margins marg; private Rectangle topRect = Rectangle.Empty; private Rectangle botRect = Rectangle.Empty; private Rectangle lefRect = Rectangle.Empty; private Rectangle rigRect = Rectangle.Empty; private void FitGlass() { // If DWM is not enabled then get out if (!this.IsGlassEnabled()) { return; } // Set the Margins to their default values marg.Top = 600; // extend from the top marg.Left = 400; // not used in this sample but could be marg.Right = 200; // not used in this sample but could be marg.Bottom = 860;// not used in this sample but could be this.Paint += new PaintEventHandler(this.Form1_Paint); // call the function that gives us glass, // passing a reference to our inset Margins welcome_page.VistaGlassEffect.VistaApi.DwmExtendFrameIntoClientArea(this.Handle, ref marg); } private void apply() { this.Paint -= new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); this.RecreateHandle(); //needed if changing on the fly this.FitGlass(); } private bool IsGlassEnabled() { //if (Environment.OSVersion.Version.Major < 6) //{ // Debug.WriteLine("How about trying this on Vista?"); // return false; //} //Check if DWM is enabled bool isGlassSupported = false; welcome_page.VistaGlassEffect.VistaApi.DwmIsCompositionEnabled(ref isGlassSupported); return isGlassSupported; } // Alpha-blending Paint after the glass extension //

          T Offline
          T Offline
          The Man from U N C L E
          wrote on last edited by
          #4

          Viswa Teja wrote:

          "DllNotFound Exception was unhandled". Well I have copyied all the dll that reqired for glass effect from vista.

          I'm impressed. If you succeeded in copying all the dlls required for the vista glass (which of course you have not) and placed them on Windows XP then you would not have XP anymore but vista as you will need the entire vista operating system for glass to work.

          If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) www.JacksonSoft.co.uk

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups