DllImport DllImportAttribute.
public delegate int MessageBoxEx(IntPtr ptr, string text, string caption, uint type);
public static MessageBoxEx MessageBox = DynamicPInvokeFactory.GetPInvokeMethod<MessageBoxEx>("user32");
- Create the delegate the same as the method to import.
- Declare the delegate field as static like example.
- Finish.