Scalabium Software

SMReport Autogenerated
Knowledge for your independence'.
Home Delphi and C++Builder tips


#86: How can I register the file extention with own application and context menu, linked to this ext?

In the next example will be registered the file extention (.newext) - files of this type will open using MyApp.Exe application. Also will be registered the one default action and two additional items in context menu, assigned
with this file extention.

Example:

uses
  Windows, Registry;

procedure TForm1.Button1Click(Sender: TObject);
begin
  with TRegIniFile.Create('') do
    try
      RootKey := HKEY_CLASSES_ROOT;
      WriteString('.newext', '', 'NewExt');
      WriteString('NewExt', '', 'Your description of NewExt files');
      WriteString('NewExt\DefaultIcon', '', 'C:\MyApp.Exe,0');
      WriteString('NewExt\Shell', '', 'This_Is_Our_Default_Action');
      WriteString('NewExt\Shell\First_Action', '','This is our first action');
      WriteString('NewExt\Shell\First_Action\command', '', 'C:\MyApp.Exe /LotsOfParamaters %1');
      WriteString('NewExt\Shell\This_Is_Our_Default_Action', '', 'This is our default action');
      WriteString('NewExt\Shell\This_Is_Our_Default_Action\command', '', 'C:\MyApp.Exe %1');
      WriteString('NewExt\Shell\Second_Action', '', 'This is our second action');
      WriteString('NewExt\Shell\Second_Action\command', '', 'C:\MyApp.Exe /TonsOfParameters %1');
   finally
      Free;
   end;
end;


Published: June 20, 2000

See also
 
SMImport suite
Paradox to Text converter
Viewer for MS Outlook Messages
Metafile Convert
SMExport suite
Fast Document Viewer
Paradox Viewer
Protected Storage Viewer
DBISAM Viewer
ABA Picture Convert
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2015, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMExport advertising