Can you call installed programs like firefox from C++ code? I would like to do this with arguements, such as which html file to open.
I suppose it would be some kind of call to the operating system?
Printable View
Can you call installed programs like firefox from C++ code? I would like to do this with arguements, such as which html file to open.
I suppose it would be some kind of call to the operating system?
Could this be done in C++ .NET?
Take a look at the spawn functions.
It would probably also be best to read where the programs are installed by looking in the registry rather than hard coding it, but just take it one step at a time for now.
Just CreateProcess(); it with the appropriate command line parameters that firefox takes for opening a certain html file. http://msdn.microsoft.com/en-us/library/ms682425.aspx
ShellExecute is typically better if you ask me. No stupid handles to close, and it is easier to call.
But this assumes the platform is Windows.
Regardless, since there is a C runtime function, use it.
ShellExecute is indeed the preferred method on Windows. It launches the URL using the default browser configured on the PC, which I would imagine you have set to Firefox in the "Set Program Access and Defaults" page of the "Add or Remove Programs" control panel, if you're a regular Firefox user. For those that just have IE, it launches that etc.
Thanks. It looks like lots of info to give me a good start.