MessageBox (user32)
Last changed: -106.166.110.35

.
Summary

C# Signature:

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

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