Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than user32, prefix the name with the module name and a period.
MessageBox (user32)
.
C# Signature:
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern MessageBoxResult MessageBox(IntPtr hWnd, String text, String caption, int options);
uint range:0~6
VB.NET Signature:
<DllImport("user32.dll", EntryPoint:="MessageBoxW", SetLastError:=True, Charset:=Charset.Unicode)> _
Public Function MessageBox(hwnd As IntPtr, _
<MarshalAs(UnmanagedType.LPTSTR)> lpText As String, _
<MarshalAs(UnmanagedType.LPTSTR)>lpCaption As String, _
<MarshalAs(UnmanagedType.U4)>uType As MessageBoxOptions) As <MarshalAs(UnmanagedType.U4)>MessageBoxResult
End Function
VB.NET Signature:
Public Declare Function MessageBox Lib "user32.dll" Alias "MessageBoxA" _
(ByVal prmlngWindowHandle As Long, _
ByVal prmstrMessage As String, _
ByVal prmstrCaption As String, _
ByVal prmlngType As MessageBoxOptions) As MessageBoxResult
/// <summary>
/// Flags that define appearance and behaviour of a standard message box displayed by a call to the MessageBox function.
/// </summary>
[Flags]
public enum MessageBoxOptions : uint
{
Ok = 0x000000,
OkCancel = 0x000001,
AbortRetryIgnore = 0x000002,
YesNoCancel = 0x000003,
YesNo = 0x000004,
RetryCancel = 0x000005,
CancelTryContinue = 0x000006,
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).