Board index » delphi » Associating file extension with a program in win95

Associating file extension with a program in win95

        Hi!

        Does somebody know if there's a way to associate file extension with a
program (i.e. like ".txt" with "c:\win95\notepad.exe") using Win32 Shell API
or I have to add the registry entries myself?

Alex.

 

Re:Associating file extension with a program in win95


Alex,
  If you modify the Win.ini file it will update the registry automatically.
 Look at the extensions section of the win.ini to see the format you have
to use.  Put IniFiles in your uses clause and then use something like this:

var
  INIFile: TIniFile;

try
  INIFile := TInifile.Create('WIN.INI');
  INIFile.WriteString('Extensions','txt','c:\win95\notepad.exe ^.txt');
finally
  INIFile.Free;
end;

Hope this helps!
--
Rod Geraghty (:>)
GERA-Tech
Ottawa, Canada
gera...@ibm.net

Alexei Novikov <Alexei_Novi...@learnlink.emory.edu> wrote in article
<Alexei_Novikov-0404971510190...@170.140.39.35>...

Quote

>    Hi!

>    Does somebody know if there's a way to associate file extension with a
> program (i.e. like ".txt" with "c:\win95\notepad.exe") using Win32 Shell
API
> or I have to add the registry entries myself?

> Alex.

Other Threads