Parameters

The ASSOCSTR value that specifies the type of string that is to be returned.

hkAssoc [in]

Type: HKEY

The HKEY value of the key that will be used as a root key. The search looks only below this key.

pszExtra [in, optional]

Type: LPCTSTR

A pointer to an optional null-terminated string with additional information about the location of the string. It is normally set to a Shell verb such as open. Set this parameter to NULL if it is not used.

pszOut [out, optional]

Type: LPTSTR

A pointer to a null-terminated string used to return the requested string. Set this parameter to NULL to retrieve the required buffer size.

pcchOut [in, out]

Type: DWORD*

A pointer to a value that, on entry, specifies the number of characters in the pszOut buffer. When the function returns, it points to the number of characters placed in the buffer.

If the ASSOCF_NOTRUNCATE flag is set in flags and the buffer specified in pszOut is too small, the function returns E_POINTER and the value is set to the required size of the buffer.

If pszOut is NULL, the function returns S_FALSE and pcchOut points to the required size of the buffer.

Return value

Type: HRESULT

Returns a standard COM error value, including the following:

Error

Meaning

S_OK

Success.

E_POINTER

The pszOut buffer is too small to hold the entire string.

S_FALSE

pszOut is NULL. pcchOut contains the required buffer size.

Remarks

This function is a wrapper for the IQueryAssociations interface. It is intended to simplify the process of using this interface. For further discussion of how the file association functions work, see IQueryAssociations.