Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29236 Discussions

Activating a program from a file extension

michael_green
Beginner
347 Views
In my application, users display a list of metadata files associated with the work they are doing. The files could be of any type - Word docs, Excel spreadsheets, PDFs, plain text, etc. I want them to be able to select a file from the list and have the appropriate program open it. I presume I need to get the file extension and do some sort of search through the registry but my attempts so far have failed. Any suggestions gratefully received.

With many thanks in advance,
Mike
0 Kudos
2 Replies
ArturGuzik
Valued Contributor I
347 Views
Quoting - michaelgreen
In my application, users display a list of metadata files associated with the work they are doing. The files could be of any type - Word docs, Excel spreadsheets, PDFs, plain text, etc. I want them to be able to select a file from the list and have the appropriate program open it. I presume I need to get the file extension and do some sort of search through the registry but my attempts so far have failed. Any suggestions gratefully received.

With many thanks in advance,
Mike
Hi Mike,

what about using ShellExecute (here an example and here an update and error codes) for that?

A.
0 Kudos
michael_green
Beginner
347 Views
Quoting - ArturGuzik
Hi Mike,

what about using ShellExecute (here an example and here an update and error codes) for that?

A.

Many thanks - that was so easy.
Mike
0 Kudos
Reply