Sunday, September 30, 2007

Example of DllImport

Here's a quick example of the DllImport attribute in action: using
System.Runtime.InteropServices;

class C
{
[DllImport("user32.dll")]
public static extern int MessageBoxA(int h, string m, string c, int
type);
public static int Main()
{
return MessageBoxA(0, "Hello World!", "Caption", 0);
}
}

No comments: