[DllImport("user32.dll",CharSet=CharSet.Auto)]
public static extern int MessageBox(IntPtr hWnd,String text,String caption,
MessageBoxStyles style);
/// MessageBoxStyles Structure
/// By Gabriel T. Sharp [osirisgothra@hotmail.com]
/// Use one or more of the following combined with bitwise-or operator
[Flags()]
public enum MessageBoxStyles:uint
{
ok=0x00000000U,
okCancel=0x00000001U,
abortretryignore=0x00000002U,
yesnocancel=0x00000003U,
yesno=0x00000004U,
retrycancel=0x00000005U,
iconhand=0x00000010U,
iconquestion=0x00000020U,
iconexclamation=0x00000030U,
iconasterisk=0x00000040U,
defbutton1=0x00000000U,
defbutton2=0x00000100U,
defbutton3=0x00000200U,
defbutton4=0x00000300U,
applmodal=0x00000000U,
systemmodal=0x00001000U,
taskmodal=0x00002000U,
help=0x00004000U,
nofocus=0x00008000U,
setforeground=0x00010000U,
default_desktop_only=0x00020000U,
topmost=0x00040000U,
right=0x00080000U,
rtlreading=0x00100000U
}
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern uint MessageBox(IntPtr hWnd, String text, String caption, uint type);
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
None.
None.
Input something
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 );
}
}
MessageBox(New IntPtr(0), "Text", "Caption", Convert.ToUInt32(MessageBoxButtons.OK))
}
System.Windows.Forms.MessageBox.Show