Dialog Options and Results

The managed and native APIs model the same dialog concepts with different shapes.

Managed Types

Type Purpose
MessageBoxOptions The full dialog request
MessageBoxButton Button identifier, label, style hint, and default/cancel flags
MessageBoxInputOptions Optional checkbox, text, password, or combo input
MessageBoxSecondaryContent Informative text, expanded text, footer, and help link
MessageBoxResult Outcome, selected button, returned input, checkbox state, timeout flag
NativeMessageBoxException Error wrapper for failure paths

Native Types

C ABI type Managed equivalent
NmbMessageBoxOptions MessageBoxOptions
NmbButtonOption MessageBoxButton
NmbInputOption MessageBoxInputOptions
NmbSecondaryContentOption MessageBoxSecondaryContent
NmbMessageBoxResult MessageBoxResult

Modeling Rules

  • At least one button is always present.
  • The managed API synthesizes a default OK button when none are supplied.
  • Input and secondary content are optional and may be downgraded by platform capabilities.
  • Timeout and cancel behavior are represented explicitly rather than inferred from button IDs alone.

Result Semantics

When a dialog completes, inspect:

  • Outcome for success, cancellation, unsupported feature, or failure
  • ButtonId for the selected button
  • InputValue when text/password/combo input was present
  • CheckboxChecked for verification/suppress state
  • WasTimeout to distinguish automatic dismissal from user choice

Capability Hints

MessageBoxOptions.PlatformCapabilities provides a small set of precomputed hints such as:

  • Whether the request requires STA on Windows
  • Whether the request uses Windows-unsupported input modes

These hints are not the full platform matrix, but they are useful for deciding whether a call should be scheduled differently.