Function Reference


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

#include <WinAPIReg.au3>
_WinAPI_AssocQueryString ( $sAssoc, $iType [, $iFlags = 0 [, $sExtra = '']] )


$sAssoc The string that is used to determine the root key. The following four types of strings can be used.
The file name extension, such as ".txt".
The class identifier (CLSID) GUID in the standard "{GUID}" format.
The application's ProgID, such as Word.Document.8.
The name of an application's .exe file. The $ASSOCF_OPEN_BYEXENAME flag must be set.
$iType The value that specifies the type of string that is to be returned. This parameter can be one of the following values:
$iFlags [optional] The flags that can be used to control the search. It can be any combination of the following values, except that only one $ASSOCF_INIT_* value can be included.
$sExtra [optional] The string with additional information about the location of the string.
It is typically set to a Shell verb such as open.

Return Value

Success: The string that contains the requested ($ASSOCSTR_*) information.
Failure: Empty string and sets the @error flag to non-zero, @extended flag may contain the HRESULT error code.

See Also

Search AssocQueryString in MSDN Library.


#include <APIRegConstants.au3>
#include <WinAPIReg.au3>

Local $sExt = '.au3'

ConsoleWrite('(' & $sExt & ')' & @CRLF)
ConsoleWrite('--------------------' & @CRLF)
ConsoleWrite('Type: ' & _WinAPI_AssocQueryString($sExt, $ASSOCSTR_FRIENDLYDOCNAME) & @CRLF)
ConsoleWrite('Command: ' & _WinAPI_AssocQueryString($sExt, $ASSOCSTR_COMMAND) & @CRLF)
ConsoleWrite('Executable: ' & _WinAPI_AssocQueryString($sExt, $ASSOCSTR_EXECUTABLE) & @CRLF)
ConsoleWrite('Icon: ' & _WinAPI_AssocQueryString($sExt, $ASSOCSTR_DEFAULTICON) & @CRLF)