@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The APPBARDATA Structure for use with the SHAppBarMessage. Also requires the [RECT] structure. !!!!C# Signature: [StructLayout(LayoutKind.Sequential)] public struct APPBARDATA { public int cbSize; // initialize this field using: Marshal.SizeOf(typeof(APPBARDATA)); public IntPtr hWnd; public uint uCallbackMessage; public uint uEdge; public RECT rc; public int lParam; } !!!!VB Signature: <StructLayout(LayoutKind.Sequential)> Structure APPBARDATA Public cbSize As Integer Public hWnd As IntPtr Public uCallbackMessage As Integer Public uEdge As Integer Public rc As RECT Public lParam As IntPtr End Structure !!!!User-Defined Types: None. !!!!Notes: Initialy the C# signature in this article used a '''public static readonly int''' for '''cbSize''' so it could be initialized inline but the static field is then no longer where you expect it to be in memory so the call to SHAppBarMessage() fails. The field cannot be static. !!!!Tips & Tricks: If you want a single line way to get an APBARDATA with the cbSize field initialized then you can add a public static method as follows: [StructLayout(LayoutKind.Sequential)] public struct APPBARDATA { public int cbSize; // initialize this field using: Marshal.SizeOf(typeof(APPBARDATA)); public IntPtr hWnd; public uint uCallbackMessage; public uint uEdge; public RECT rc; public int lParam; public static APPBARDATA NewAPPBARDATA() { APPBARDATA abd = new APPBARDATA(); abd.cbSize = Marshal.SizeOf(typeof(APPBARDATA)); return abd; } } ... APPBARDATA myBarData = APPBARDATA.NewAPPBARDATA(); myBarData.hWnd = MyBar.Handle; ... !!!!Sample Code: Please add some! !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: APPBARDATA@msdn on MSDN
Edit shell32.APPBARDATA
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.