Glass Effect in XP using dwmapi.dll
-
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 //
-
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 //
-
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 //
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[^]
-
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 //
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