SHGetUserPicturePath

Go to Home Page

Copies the users account picture to a temporary directory and returns the path or returns various paths relating to user pictures

Syntax

HRESULT WINAPI SHGetUserPicturePath (
    LPCWSTR pwszPicOrUserName,
    DWORD sguppFlags,
    LPWSTR pwszPicPath,
    UINT picPathLen
)

Parameters

pwszPicOrUserName
The name of a user account on this computer, or desired file name of the current users picture. Can be NULL to indicate the current users' name.
sguppFlags
Function options, see SHGetUserPicturePathEx for values and descriptions
pwszPicPath
A pointer to a buffer that receives the path of the copied file. Cannot be NULL.
picPathLen
Length of the pwszPicPath buffer in chars

Return Value

S_OK on success, standard COM error on failure

Remarks

Forwards to SHGetUserPicturePathEx as:

HRESULT WINAPI SHGetUserPicturePath(LPCWSTR pUserOrPicName, DWORD sguppFlags, LPWSTR pwszPicPath, UINT picPathLen)
{
    return SHGetUserPicturePathEx(pUserOrPicName, sguppFlags, NULL, pwszPicPath, picPathLen, NULL, 0);
}

On XP and Server 2003, the prototype is:

// pwszPicPath is assumed to be MAX_PATH in size
void WINAPI SHGetUserPicturePathW(LPCWSTR pUserOrPicName, DWORD sguppFlags, LPWSTR pwszPicPath);

This function is also known as _SHGetUserPicturePath@16 and _SHGetUserPicturePathW@12.