ShellMessageBoxA function

[ShellMessageBox is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

ShellMessageBox is a special instance of MessageBox that provides the option of using the owner window's title as the title of the message box.

Syntax

int ShellMessageBoxA(
  HINSTANCE hAppInst,
  HWND      hWnd,
  LPCSTR    lpcText,
  LPCSTR    lpcTitle,
  UINT      fuStyle,
  ...       
);

Parameters

hAppInst

Type: HINSTANCE

The handle of the module from which to load a string resource named in pszTitle. If pszTitle does not name a string resource, this parameter is ignored. This value must be valid if pszMsg or pszTitle is a resource ID.

hWnd

Type: HWND

A handle to the owner window of the message box to be created. If this variable is not NULL, the title of the owner window is used as the title of the message box.

lpcText

Type: LPCTSTR

A pointer to a null-terminated string that contains either the message to be displayed or a resource ID specifying where the message is to be retrieved from.

lpcTitle

Type: LPCTSTR

A pointer to a null-terminated string that contains the dialog box title or a resource ID specifying where the title is to be retrieved. If both this parameter and hWnd are NULL, no title is displayed. If this parameter points to a loadable resource formed with the MAKEINTRESOURCE macro, it overrides hWnd as the title.

fuStyle

Type: UINT

Specifies the contents and behavior of the dialog box. For possible values, see MessageBox.

arg6

A variable argument list that is combined with pszMsg to form the full text displayed in the message box.

Return Value

Type: int

An integer value indicating a button that was pressed in the message box. For specific values, see MessageBox.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shellapi.h
Library Shlwapi.lib
DLL Shlwapi.dll

See Also

MAKEINTRESOURCE

MessageBox