|
Example |
|
| dcFileAssociation component.
|
| function TdcFileAssociation.InstallFileType(Extension, ExecutableFile, ParamString, MIMEType, ExtDescription, FileDescription, IconFile: String; IconIndex: Integer): Boolean;
|
| The InstallFileType method is the alternative way to install the new file type to the Windows shell.
|
|
|
| Parameters | Meaning
|
| Extension | specifies the file extension. For example, '.test';
|
| ExecutableFile | specifies the executable file associated with this file type (see ExecutableFile property);
|
| ParamString | specifies the command-line parameters to transmit to the executable file on startup (see ParamString property);
|
| MIMEType | specifies the media-type of the extension (see MIMEType property). This parameter can be empty;
|
| ExtDescription | unique identifier for file extension, used internally within Windows shell (see ExtDescription property);
|
| FileDescription | description of file type (will be visible in Windows explorer and "Properties" dialog) (see FileDescription property);
|
| IconFile | location of the icon file (can be an EXE, DLL or ICO) (see IconLocation property);
|
| IconIndex | index of the icon in the IconFile (see IconIndex property).
|
|
|
| procedure TForm1.InstallButtonClick(Sender: TObject);
|
| begin
|
| dcFileAssociation1.InstallFileType('.avi',
|
| 'C:\Program Files\Windows Media Player\MPLAYER2.EXE', '%1', '',
|
| 'avifile', 'AVI Clip', '', 0);
|
| end;
|
| UninstallFileType method;
|
| ExecutableFile, ParamString, MIMEType, ExtDescription, FileDescription, IconLocation and IconIndex properties.
|