ShlwApiAssocQueryString Method
Searches for and retrieves a file or protocol association-related string from the registry.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Ansi, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
public static HResult AssocQueryString(
AssocF flags,
AssocStr str,
string assoc,
string extra,
StringBuilder out,
out uint refOutSize
)
<DllImportAttribute("ShlwApi.dll", CharSet := CharSet.Ansi, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function AssocQueryString (
flags As AssocF,
str As AssocStr,
assoc As String,
extra As String,
<OutAttribute> out As StringBuilder,
<OutAttribute> ByRef refOutSize As UInteger
) As HResult
Dim flags As AssocF
Dim str As AssocStr
Dim assoc As String
Dim extra As String
Dim out As StringBuilder
Dim refOutSize As UInteger
Dim returnValue As HResult
returnValue = ShlwApi.AssocQueryString(flags,
str, assoc, extra, out, refOutSize)
public:
[DllImportAttribute(L"ShlwApi.dll", CharSet = CharSet::Ansi, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static HResult AssocQueryString(
AssocF flags,
AssocStr str,
String^ assoc,
String^ extra,
[OutAttribute] StringBuilder^ out,
[InAttribute] [OutAttribute] unsigned int% refOutSize
)
[<DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Ansi, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member AssocQueryString :
flags : AssocF *
str : AssocStr *
assoc : string *
extra : string *
out : StringBuilder byref *
refOutSize : uint32 byref -> HResult
No code example is currently available or this language may not be supported.
- flags AssocF
-
The flags that can be used to control the search.
It can be any combination of AssocF values, except that only one AssocF.Ini*** value can be included.
- str AssocStr
-
An AssocStr value that specifies the type of string that is to be returned.
- assoc String
-
A pointer to a null-terminated string that is used to determine the root key.
The following four types of strings can be used:
- A file name extension, such as '.txt'.
- A CLSID GUID in the standard '{GUID}' format.
- An application's ProgID, such as 'Word.Document.8.'
- The name of an application's .exe file (The ASSOCF_OPEN_BYEXENAME flag must be set in flags).
- extra String
-
An optional null-terminated string with additional information about the location of the string.
It is typically set to a Shell verb such as 'open'.
Set this parameter to if it is not used.
- out StringBuilder
-
Pointer to a null-terminated string that, when this function returns successfully, receives the requested string.
Set this parameter to to retrieve the required buffer size.
- refOutSize UInt32
-
A pointer to a value that, when calling the function, is set to the number of characters in the out buffer.
When the function returns successfully, the value is set to the number of characters actually placed in the buffer.
If the NoTruncate flag is set in flags and the
buffer specified in out is too small,
the function returns E_POINTER and the value is set to the required size of the buffer.
If out is ,
the function returns S_FALSE and refOutSize points to the required size, in characters, of the buffer.
HResult
Returns a standard COM error value, including the following:
S_OK: Success.
E_POINTER: The
out buffer is too small to hold the entire string.
S_FALSE:
out is
,
refOutSize contains the required buffer size.