www.icetips.com  Icetips Utilities Documentation 6/29/2009    

Shell Class:  AssociateProgram

Previous  Top  Next  


Prototype: (String pProgramExe, String pFileExt, String pFileTypeName, Long pIconIndex=0),BYTE !! Returns True if association was successfull.

 

pProgramExePath and name of the executable to associate with the file extension specified in pFileExt
pFileExtFull 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
pFileTypeNameName for the file type. 
pIconIndexIndex for the icon to use with the association.  Defaults to the default icon of the executable (0)

 

ReturnsReturns 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

 



Direct link to this page: http://www.icetips.com/manuals/utilities/associateprogram_shellclass.htm