using System using System Runtime InteropServices class Test DllImport

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
using System;
using System.Runtime.InteropServices;
class Test
{
[DllImport("user32.dll")]
public static extern int MessageBox(IntPtr h, string m, string c, int type);
public static void Main()
{
int retval = MessageBox(IntPtr.Zero, "Hello", "Caption", 0);
}
}