Function Reference


_WinAPI_PathParseIconLocation

Parses a file location string that contains a file location and icon index

#include <WinAPIShPath.au3>
_WinAPI_PathParseIconLocation ( $sFilePath )

Parameters

$sFilePath The path that contains a file location string. It should be in the form "path,iconindex".

Return Value

Returns the array containing the following information:
[0] - The path of the file that contains the icon.
[1] - The index of the icon.

Remarks

This function is useful for taking a DefaultIcon value from the registry and separating the icon index from the path.

See Also

Search PathParseIconLocation in MSDN Library.

Example

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

Local $sData = _WinAPI_AssocQueryString('.txt', $ASSOCSTR_DEFAULTICON)
Local $aIcon = _WinAPI_PathParseIconLocation($sData)

If IsArray($aIcon) Then
    ConsoleWrite('DefaultIcon: ' & $sData & @CRLF)
    ConsoleWrite('Icon: ' & $aIcon[0] & @CRLF)
    ConsoleWrite('Index: ' & $aIcon[1] & @CRLF)
EndIf