Mirror

Open registered files (Views: 41)


Problem/Question/Abstract:

How to open a registered file from Delphi

Answer:

Example:

OpenRegisteredFile('c:\windows\desktop\MyHTML.html');
OpenRegisteredFile('d:\data\MyDocuments\FAQ.doc');
OpenRegisteredFile('c:\mp3z\MyFavMp3.mp3');

uses
  WinTypes, ShellApi;

procedure OpenRegisteredFile(Path: string);
begin
  ShellExecute(0, nil, PChar(Path), nil, nil, SW_NORMAL);
end;

<< Back to main page