: Hi. You could try ShellExecute. I'd suggest searching this forum or google for more info on this function (I have no code here with me).
: hth, pritaeas
: : Ideally, of course, I would like to have a function that will
: : recognize a type of file and itself choose a program to open this
: : file with. Kind of what Windows does when I click on any file. Is
: : there any way how I can make this?
Try the TFileRun object in the ExtActns.pas unit. It works great and is easy to use.
Here's the help
TFileRun is the standard action for performing a specified operation on a file.
Add TFileRun to an action list to let your application launch an external application or dll in response to user actions. Controls linked to this action cause your application to perform the operation specified by the Operation property on the file specified by the FileName property.
Before this action fires, configure its properties to indicate what application to launch and how to launch it:
To indicate the target file to run, set the FileName property to the name of a file on which the external application operates or to the name of the applications executable file. If you want to let the user select the file name instead when the action fires, set the Browse property to True, and an open dialog appears when the action fires.
To indicate what action to perform on the specified file, set the Operation property.
To supply parameters to the external application when it is launched, use the Parameters property.
To specify a default directory for the external application, use the Directory property.
To control how the external applications window appears (minimized, maximized, hidden, and so on), use the ShowCmd property.
If the external application needs a parent window (to parent a dialog such as a properties dialog), or if you want to allow TFileRun to display error messages, use the ParentControl property.
Happy coding !