Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than shell32, prefix the name with the module name and a period.
APPBARDATA (shell32)
.
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;
}
}
The SHAppBarMessage API. Uses the [APPBARDATA] structure.
6/15/2019 8:41:15 AM - -120.236.174.156
The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.
6/3/2013 5:41:04 PM - dahminator-75.174.65.168
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).