# $InputObject.ShowMessageBox

> Shows a MessageBox to the logged on user. If a MessageBox is already shown, it will be replaced.

Source: https://docs.capaone.com/capainstaller/powerpacks/inputobject-showmessagebox/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Shows a MessageBox to the logged on user. If a MessageBox is already shown, it will be replaced.

### Syntax

\[string\] `$InputObject.ShowMessageBox`(caption, text, buttons, default, iconStyle, timeOut aSync)

### Considerations for Æ Ø Å

There are no specific considerations for the use of special characters (unlike Sys\_BreakThruMsgBox)

### Parameters

#### sCaption (String)

Title of the messagebox

#### sText (String)

Text in the messagebox

#### sButtons (String)

Specifies button-type. Valid values: 'OK', 'YESNO', 'YESNOCANCEL', 'ABORTRETRYIGNORE', 'OKCANCEL' and 'RETRYCANCEL'

#### sDefault (String)

Specifies the default button in messagebox. Valid values:  'ONE', 'TWO' or 'THREE'

#### sIconStyle (String)

Used Icon-style in messagebox. Valid values: 'STOP', 'QUESTION', 'EXCLAMATION', 'INFORMATION'

#### iTimeOut (Integer)

This is the timeout of the messagebox shown. If the user has not clicked any of the buttons withing the timeout, the default button is returned

#### bASync (Boolean)

Specifies if the messagebox displays asynchronously($true) or waits for the user to respond($false)

### Return value

Result will be returned from the function. Valid answers are: 'OK', 'YES', 'NO', 'ABORT', 'RETRY', 'CANCEL' and 'IGNORE'

### Example:

**PowerShell**

```powershell
  $cs.Job_WriteLog("Showing MessageBox")
  $messageBoxResponse = $InputObject.ShowMessageBox("MessageBox title", "This is a test messageBox from a PowerPack (æøå). Please click one of the three buttons below", "YESNOCANCEL", "TWO", "Info", 180, $false)
  $cs.Job_WriteLog("response: $messageBoxResponse")
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Sys_BreakthruMsgbox](/capainstaller/vb-scripting-library/system-functions/sys-breakthrumsgbox/) [$InputObject.CloseMessageBox](/capainstaller/powerpacks/inputobject-closemessagebox/)
