SHEnumerateUnreadMailAccountsW function (shellapi.h)

Enumerates the user accounts that have unread email.

Syntax

HRESULT SHEnumerateUnreadMailAccountsW(
  [in, optional] HKEY   hKeyUser,
                 DWORD  dwIndex,
  [out]          LPWSTR pszMailAddress,
                 int    cchMailAddress
);

Parameters

[in, optional] hKeyUser

Type: HKEY

A valid HKEY for a given user.

dwIndex

Type: DWORD

The index of the user account.

[out] pszMailAddress

Type: LPTSTR

A pointer to a Unicode string that specifies the email address of an account belonging to the specified user.

cchMailAddress

Type: int

The number of characters in the email address.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The hKeyUser parameter is the HKEY for the root of the user's information, for example HKEY_CURRENT_USER, or any key enumerated under HKEY_USERS.

Note

The shellapi.h header defines SHEnumerateUnreadMailAccounts as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

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