IQueryAssociations::GetString method

Searches for and retrieves a file or protocol association-related string from the registry.

Syntax


HRESULT GetString(
  [in]             ASSOCF flags,
  [in]             ASSOCSTR str,
  [in, optional]   LPCWSTR pwszExtra,
  [out, optional]  LPWSTR pwszOut,
  [in, out]        DWORD *pcchOut
);

Parameters

flags [in]

Type: ASSOCF

A flag that can be used to control the search. It can be any combination of the following ASSOCF values.

str [in]

Type: ASSOCSTR

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

pwszExtra [in, optional]

Type: LPCWSTR

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

pwszOut [out, optional]

Type: LPWSTR

A pointer to a null-terminated Unicode 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, is set to the number of characters in the pwszOut buffer. When the function returns successfully, 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 pwszOut is too small, the function returns E_POINTER and pcchOut points to the required size of the buffer.

If pwszOut 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:

ErrorMeaning
S_OKSuccess.
E_POINTERThe pwszOut buffer is too small to hold the entire string.
S_FALSEpwszOut is NULL. pcchOut contains the required buffer size.

 

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shell32.dll (version 5.0 or later)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft