PInvoke.net : Far beyond managed code (DllImport inside)

PInvoke.net is primarily a wiki, allowing developers to find, edit and add PInvoke* signatures, user-defined types, and any other information related to calling Win32 and other unmanaged APIs from managed code (written in languages such as C# or VB.NET).

sample code :

[DllImport("aygshell.dll")]
static extern uint SHRecognizeGesture(ref SHRGINFO shrg);

[StructLayout(LayoutKind.Sequential)]
class SHRGINFO
{
   public uint cbSize = 0;
   public IntPtr hwndClient = IntPtr.Zero;
   public int x = 0; // POINT
   public int y = 0; // POINT
   public uint dwFlags = 0;
}

const uint GN_CONTEXTMENU = 1000;
const uint SHRG_RETURNCMD = 0x00000001;
const uint SHRG_NOTIFYPARENT = 0x00000002;
const uint SHRG_LONGDELAY = 0x00000008;
const uint SHRG_NOANIMATION = 0x00000010;

Leave a Reply