|
Previous Top Next |
Prototype: | (String pProgramExe, String pFileExt, String pFileTypeName, Long pIconIndex=0),BYTE !! Returns True if association was successfull. |
pProgramExe | Path and name of the executable to associate with the file extension specified in pFileExt |
pFileExt | Full file extension (i.e. in the format of ".extension" note the prefixed period) of the file type to associate with the executable file specified in pProgramExe |
pFileTypeName | Name for the file type. |
pIconIndex | Index for the icon to use with the association. Defaults to the default icon of the executable (0) |
Returns | Returns true if the association was successful. |
This methods makes it easy to associate specific program with specific file extension so that double clicking on the file in Windows Explorer will load the program. Note that it is up to the developer to parse the command line parameters of the program.
Note that executing this method from a non-elevated program under Vista, Windows Server 2008 or Windows 7 will trigger virtualization writing to the registry keys and the information may be written to the HKEY_CURRENT_USER instead of HKEY_CLASSES_ROOT.
Example:
If Message('This will associate ".abcdefg" with the ShellClassDemo program. Do you want to continue?',|
'Associate extension with this program?',ICON:Question,BUTTON:Yes+BUTTON:No,BUTTON:No) = BUTTON:Yes
ITS.AssociateProgram(ITS.EXEName,'.abcdefg','Icetips.CoreClassDemo')
End
See also:
GetAssociatedProg
GetAssociatedVerb
ShellExec
ShellExecEx
ITRunFile
OpenURL