GetAssociatedIconKey

 

Description

This function returns a 'unique' key for the icon associated with the specified file name.
This key can then be used to uniquely identify an icon to be added to an imagelist.

GetAssociatedIconKey used the following method to construct the key :
- If the specified file contains an icon, the function returns the filename itself.
- Otherwise the type of the file (or folder) is returned as " *.<type of file/folder>".
- If the specified file/folder does not exist, the string " *.[Unknown]" is returned.

Syntax

[Key =] oDlg.GetAssociatedIconKey ( File )

Parameters

Part

Description

Key =

String variable to which the return value (key) is assigned

Odlg

A reference to the WshDialog.Kit automation object (as returned by the Wscript or VBScript CreateObject methods)

File

The name of the file you want to retrieve a 'unique' icon key for.
Both absolute and relative paths are valid.

Example

See the GetAssociatedIcon page for an example