MessageBox (user32)
Last changed: -106.166.110.35

.
Summary
The MessageBox API(CHS:系统消息框API)

C# Signature (New)

     [DllImport("user32.dll",CharSet=CharSet.Auto)]
      public static extern int MessageBox(IntPtr hWnd,String text,String caption,
       MessageBoxStyles style);        rtlreading=0x00100000U
    }

C# Signature (Original):

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

uint range:0~6

VB Signature:

Imports System.Runtime.InteropServices
<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
Shared Function MessageBox(ByVal hwnd As IntPtr, ByVal t As String, ByVal caption As String, ByVal t2 As UInt32) As Integer
End Function

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Input something

Sample Code C#:

    using System;
    using System.Runtime.InteropServices;    

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

        [STAThread]
        static void Main(string[] args)
        {
            Class1.MessageBox(new IntPtr(0), "Text", "Caption", 0 );
        }
    }

Sample Code VB:

        MessageBox(New IntPtr(0), "Text", "Caption", Convert.ToUInt32(MessageBoxButtons.OK))

}

Alternative Managed API:

System.Windows.Forms.MessageBox.Show

Documentation
MessageBox on MSDN