コンソールアプリケーションでメッセージボックスを表示する例

[DllImport("USER32.DLL")]
public static extern int MessageBoxA(
int hWnd, String lpText, String lpCaption, uint uType
);

public const int MB_OK = 0x00000000;
public const int MB_OKCANCEL = 0x00000001;
public const int MB_ABORTRETRYIGNORE = 0x00000002;
public const int MB_YESNOCANCEL = 0x00000003;
public const int MB_YESNO = 0x00000004;
public const int MB_RETRYCANCEL = 0x00000005;

public const int MB_ICONHAND = 0x00000010;
public const int MB_ICONQUESTION = 0x00000020;
public const int MB_ICONEXCLAMATION = 0x00000030;
public const int MB_ICONASTERISK = 0x00000040;
[DllImport("User32.Dll", EntryPoint = "SetWindowText")]

そしてメイン関数の中で、
Win32.MessageBoxA(0, "残念外れ!!",
"結果表示", Win32.MB_OK);
を呼び出す