using System; public class DllImportAttribute : Attribute { public DllImportAttribute(string filename) { } public string EntryPoint { get; set; } } public struct CAPDRIVERCAPS { } public class Test { [DllImport("User32.dll", EntryPoint = "SendMessage")] private static extern bool SendMsgB(IntPtr hWnd, int Msg, int wParam, ref T lParam) where T : struct; public static bool capDriverGetCaps(IntPtr hwnd, ref CAPDRIVERCAPS psCaps, int wSize) { return SendMsgB(hwnd, WM_CAP_DRIVER_GET_CAPS, wSize, ref psCaps); } const int WM_CAP_DRIVER_GET_CAPS = 4711; public static void Main() { CAPDRIVERCAPS cdc; capDriverGetCaps(IntPtr.Zero, ref cdc, 0); } }