Open a file using its associated application

The result is the same as if the file were double-clicked in Windows Explorer.



FUNCTION OpenFile(AFile: STRING; ADir: STRING = NIL; AParams: STRING = NIL):
boolean;
BEGIN
result := ShellExecute(Application.Handle, ’open’, PChar(AFile), ADir, AParams,
SW_SHOWNORMAL) >= 32;
END;