Mega Code Archive

 
Categories / C# Tutorial / Windows
 

Invoke MessageBox in Dll

using System; using System.Runtime.InteropServices; using System.Collections.Generic; using System.Text;     class Program     {         [DllImport("user32.dll")]         public static extern int MessageBox(IntPtr hwnd, String text, String caption, uint type);         static void Main(string[] args)         {             MessageBox(new IntPtr(0), "Greetings from Platform Invoke", "Platform Invoke", 0);         }     }