1 out of 1 rated this helpful - Rate this topic

ShellAbout function

Applies to: desktop apps only

Displays a ShellAbout dialog box.

Syntax

int ShellAbout(
  __in_opt  HWND hWnd,
  __in      LPCTSTR szApp,
  __in_opt  LPCTSTR szOtherStuff,
  __in_opt  HICON hIcon
);

Parameters

hWnd [in, optional]

Type: HWND

A window handle to a parent window. This parameter can be NULL.

szApp [in]

Type: LPCTSTR

A pointer to a null-terminated string that contains text to be displayed in the title bar of the ShellAbout dialog box and on the first line of the dialog box after the text "Microsoft". If the text contains a separator (#) that divides it into two parts, the function displays the first part in the title bar and the second part on the first line after the text "Microsoft".

Windows 2000, Windows XP, Windows Server 2003: If the string pointed to by this parameter contains a separator (#), then the string must be writeable.

Windows Vista, Windows Server 2008: This string cannot exceed 200 characters in length.

szOtherStuff [in, optional]

Type: LPCTSTR

A pointer to a null-terminated string that contains text to be displayed in the dialog box after the version and copyright information. This parameter can be NULL.

hIcon [in, optional]

Type: HICON

The handle of an icon that the function displays in the dialog box. This parameter can be NULL, in which case the function displays the Windows icon.

Return value

Type: int

TRUE if successful; otherwise, FALSE.

Remarks

Note that the ShellAbout function dialog box uses text and a default icon that are specific to Windows.

To see an example of a ShellAbout dialog box, choose About Windows from the Help menu drop-down list in Windows Explorer.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Shellapi.h

Library

Shell32.lib

DLL

Shell32.dll (version 3.51 or later)

Unicode and ANSI names

ShellAboutW (Unicode) and ShellAboutA (ANSI)

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Platform Invoke Code Snippet (ShellAbout)
/// <summary>
/// Displays a ShellAbout dialog box. (ANSI version)
/// </summary>
/// <remarks>
/// Note that the ShellAbout function dialog box uses text and a default icon that are specific to Windows. To see an example of a ShellAbout dialog box, choose About Windows from the Help menu drop-down list in Windows Explorer.
/// </remarks>
/// <param name="hWnd">A window handle to a parent window. This parameter can be NULL.</param>
/// <param name="szApp">A pointer to a null-terminated string that contains text to be displayed in the title bar of the ShellAbout dialog box and on the first line of the dialog box after the text "Microsoft". If the text contains a separator (#) that divides it into two parts, the function displays the first part in the title bar and the second part on the first line after the text "Microsoft". Windows 2000, Windows XP, Windows Server 2003: If the string pointed to by this parameter contains a separator (#), then the string must be writeable. Windows Vista, Windows Server 2008: This string cannot exceed 200 characters in length. </param>
/// <param name="szOtherStuff">A pointer to a null-terminated string that contains text to be displayed in the dialog box after the version and copyright information. This parameter can be NULL.</param>
/// <param name="hIcon">The handle of an icon that the function displays in the dialog box. This parameter can be NULL, in which case the function displays the Windows icon.</param>
/// <returns>TRUE if successful; otherwise, FALSE.</returns>
[DllImport("shell32.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int ShellAboutA(
    [In] IntPtr hWnd,
    [In] string szApp,
    [In] string szOtherStuff,
    [In] IntPtr hIcon);

/// <summary>
/// Displays a ShellAbout dialog box. (Unicode version)
/// </summary>
/// <remarks>
/// Note that the ShellAbout function dialog box uses text and a default icon that are specific to Windows. To see an example of a ShellAbout dialog box, choose About Windows from the Help menu drop-down list in Windows Explorer.
/// </remarks>
/// <param name="hWnd">A window handle to a parent window. This parameter can be NULL.</param>
/// <param name="szApp">A pointer to a null-terminated string that contains text to be displayed in the title bar of the ShellAbout dialog box and on the first line of the dialog box after the text "Microsoft". If the text contains a separator (#) that divides it into two parts, the function displays the first part in the title bar and the second part on the first line after the text "Microsoft". Windows 2000, Windows XP, Windows Server 2003: If the string pointed to by this parameter contains a separator (#), then the string must be writeable. Windows Vista, Windows Server 2008: This string cannot exceed 200 characters in length. </param>
/// <param name="szOtherStuff">A pointer to a null-terminated string that contains text to be displayed in the dialog box after the version and copyright information. This parameter can be NULL.</param>
/// <param name="hIcon">The handle of an icon that the function displays in the dialog box. This parameter can be NULL, in which case the function displays the Windows icon.</param>
/// <returns>TRUE if successful; otherwise, FALSE.</returns>
[DllImport("shell32.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int ShellAboutW(
    [In] IntPtr hWnd,
    [In] string szApp,
    [In] string szOtherStuff,
    [In] IntPtr hIcon);

/// <summary>
/// Displays a ShellAbout dialog box. (Character set auto selection)
/// </summary>
/// <remarks>
/// Note that the ShellAbout function dialog box uses text and a default icon that are specific to Windows. To see an example of a ShellAbout dialog box, choose About Windows from the Help menu drop-down list in Windows Explorer.
/// </remarks>
/// <param name="hWnd">A window handle to a parent window. This parameter can be NULL.</param>
/// <param name="szApp">A pointer to a null-terminated string that contains text to be displayed in the title bar of the ShellAbout dialog box and on the first line of the dialog box after the text "Microsoft". If the text contains a separator (#) that divides it into two parts, the function displays the first part in the title bar and the second part on the first line after the text "Microsoft". Windows 2000, Windows XP, Windows Server 2003: If the string pointed to by this parameter contains a separator (#), then the string must be writeable. Windows Vista, Windows Server 2008: This string cannot exceed 200 characters in length. </param>
/// <param name="szOtherStuff">A pointer to a null-terminated string that contains text to be displayed in the dialog box after the version and copyright information. This parameter can be NULL.</param>
/// <param name="hIcon">The handle of an icon that the function displays in the dialog box. This parameter can be NULL, in which case the function displays the Windows icon.</param>
/// <returns>TRUE if successful; otherwise, FALSE.</returns>
[DllImport("shell32.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Auto, ExactSpelling = false)]
static extern int ShellAbout(
    [In] IntPtr hWnd,
    [In] string szApp,
    [In] string szOtherStuff,
    [In] IntPtr hIcon);
Remark about the implementation problem
Only the unicode implementation ShellAboutW() attempts to modify the string. The ANSI version ShellAboutA() is protected from the problem because it allocates a temporary string for conversion, before calling ShellAboutW().
szApp parameter should be writable (LPTSTR) if it contains the # separator

The implementation of this function (under XP SP2 at least) appears to write to the szApp string if you use the # separator. If you use this format you should use it like this to ensure you're passing a writable string:

TCHAR Txt[] = TEXT("First part...#Second part...");

ShellAbout( hWnd, Txt, T("Other stuff..."), NULL );