DllImport : DllImport « Windows « C# / CSharp Tutorial






using System;
using System.Runtime.InteropServices;

class MainClass
{
  [DllImport("user32.dll", CharSet = CharSet.Auto)]
  public static extern int MessageBox(int hWnd, String text, String caption, uint type);

  [STAThread]
  static void Main(string[] args)
  {
    MessageBox(0, "Hello World", "MyBox", 1);
  }
}








29.12.DllImport
29.12.1.DllImport: load dll library
29.12.2.DllImport
29.12.3.External Method
29.12.4.Get address of a method from Dll
29.12.5.API File reader