Casimiro Notevi |
20-06-2006 15:22:35 |
Buscar Ejecutable asociado a extensión
Código Delphi [-]
function BuscarEjecutableAsociado( Fichero:string ):string;
var
Ejecutable:Pchar;
begin
GetMem(Ejecutable,200);
FindExecutable(Pchar(Fichero),nil,Ejecutable);
Result:=String(Ejecutable);
FreeMem(Ejecutable,200);
end;
Y la llamada sería algo así como:
Código Delphi [-]
cPrograma := BuscarEjecutableAsociado( 'c:\libros\CaraOcultaDelphi.pdf' );
Esto devolvería algo así: 'C:\Archivos de programa\Adobe\Acrobat 7.0\Reader\AcroRd32.exe'
|