MailGetFolderName

The MailGetFolderName function retrieves the name of a mail folder from the message store.

Syntax

BOOL MailGetFolderName (HANDLE hMail, int* piId, int* piLen LPWSTR szName);

At a Glance

Header file: Msgstore.h
Platforms: H/PC
Versions: 1.0 and later

Parameters

hMail
Handle to the mail context. This handle is created by the MailOpen function.
piId
Pointer to the identification number specifying the mail folder. The identifier, a unique integer from zero to 255, is set by the MailPutFolder function.

After calling MailGetFolderName, if the folder specified by szName cannot be found, the value pointed to by piId is the identifier of the next folder found. If no folder can be found, then piId points to a negative value.

piLen
Pointer to the length, in characters, of the szName buffer parameter. If the string is longer than (piLen - 1), it is truncated.

After calling MailGetFolderName, the value pointed to by piLen is the actual number of characters needed for the string being passed back to szName plus a NULL terminator character.

szName
Pointer to the buffer receiving the name of the mail folder corresponding with the specified identification number.

Return Values

This function returns TRUE if successful; FALSE if it fails. To get extended error information, use MailError or MailErrorMsg.

Remarks

For more information, see Inbox.

See Also

MailPutFolder, MailGetFolderId