Ok, so I followed the documents down to the smallest detail, and it continues to give me the following error when trying to debug and start (F5):
PInvokeStackImbalance detected Message: Calling PInvoke 'VistaControls! VistaControls.Dwm.NativeMethods :: DwmExtendFrameIntoClientArea 'has an unbalanced stack. This is likely because the PInvoke managed signature does not match the unmanaged target signature. Ensure that the calling agreement and parameters of the PInvoke signature match the target unmanaged signature.
I have no idea what this means, or how to fix it! Can anyone help? Any suggestions?
I have used this before, but this time it does not work. I am using VS2010 Express C # WinForms, .NET 4 (As before, when I first used it many years ago.)
thanks
Link: http://windowsformsaero.codeplex.com/wikipage?title=Glass%20on%20WinForms&referringTitle=Documentation
And yes, I noticed a fix that the person made at the bottom of this page, and I fixed it, but it still doesn't work!
Code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using VistaControls.Dwm; namespace One_Stop_Management { public partial class Form1 : Form { public Form1() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.FillRectangles(Brushes.Black, new Rectangle[] { new Rectangle(0, 0, this.ClientSize.Width, 30), new Rectangle(this.ClientSize.Width - 30, 0, 30, this.ClientSize.Height), new Rectangle(0, this.ClientSize.Height - 30, this.ClientSize.Width, 30), new Rectangle(0, 0, 30, this.ClientSize.Height) }); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); VistaControls.Dwm.DwmManager.EnableGlassSheet(this); } } }
anon271334
source share