ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
ShellBrowser.TShellControlHelper.AssociateIconWithExtension

Manipulates the registry to change the icon used for the given pFileExtensions

Syntax
Pascal
class function AssociateIconWithExtension(pFileExtension: string; pIconFile: string; const pIconIndex: Integer = -1): Integer;
Parameters 
Description 
pFileExtension: string 
The file extension the icon should be associated with 
pIconFile: string 
The file containing the icon. Either a path to an image or an exe or dll file (e.g. "%SystemRoot%\System32\shell32.dll" 
const pIconIndex: Integer = -1 
Optional. If an exe or dll file is passed in pIconFile the index of the icon 

Integer: the index of the symbol in the system image list

Since the registry is persistently changed, the function cannot be rolled back. Changes might only be available/visible after restarting the program. The function only sets the icon for the filetypes. Program associations remain unchanged.