Function Reference


_WinAPI_MessageBoxCheck

Displays a message box that gives the user the option of suppressing further occurrences

#include <WinAPIDlg.au3>
_WinAPI_MessageBoxCheck ( $iType, $sTitle, $sText, $sRegVal [, $iDefault = -1 [, $hParent = 0]] )

Parameters

$iType The flags that specify the contents and behavior of the message box.

You must specify the buttons to be displayed by setting one and only one of the following flags.
$MB_OK
$MB_OKCANCEL
$MB_YESNO

You can display an optional icon by setting one and only one of the following flags.
$MB_ICONEXCLAMATION
$MB_ICONHAND
$MB_ICONINFORMATION
$MB_ICONQUESTION
$sTitle The string that contains the title of the message box.
$sText The string that contains the message to be displayed.
$sRegVal The string that contains a unique string value to associate with this message.
$iDefault [optional] The value that the function returns when the user has opted not to have the message box displayed
again. If the user has not opted to suppress the message box, the message box is displayed and
the function ignores $iDefault.
$hParent [optional] The window handle to the message box's owner.

Return Value

Success: If the user has already chosen to suppress the message box, the function immediately returns the
value assigned to $iDefault, otherwise, returns one of the $ID_* constants.
Failure: (-1).

Remarks

This function records the message boxes that the user has chosen to suppress under the following registry key.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\LowRegistry\DontShowMeThisDialogAgain

See Also

Search SHMessageBoxCheck in MSDN Library.

Example

#include <MsgBoxConstants.au3>
#include <WinAPIDlg.au3>

Local $iResult = _WinAPI_MessageBoxCheck($MB_ICONINFORMATION, 'MyProg', '_WinAPI_MessageBoxCheck()', 'MyProg')

ConsoleWrite('Return: ' & $iResult & @CRLF)