Open HTML file in default browser through C++
Hi, I was just wondering if it is possible in Linux to perform a command where you specify an HTML file and Linux automatically opens it in the default Web Browser. I know more or less how to do it in Windows (as our project should run in Windows & Linux), but I need to know if I can do it in Linux.
Its for Help files. Thanks :) |
There is no 'default web browser'...this is linux, choice is the order of the day! :D You'll have to specify the command to open the browser..possibly trying several until one works.
|
No I mean Linux detects what the user's Browser of choice is like in Windows and when you open the HTML file, Linux opens that Browser.
Also, if the above method can't work, can anyone please give me some tips on alternatives of how to accomplish this? Thanks |
Nevermind, I've found a html help viewer in wxWidgets (the framework I'm using).
So to display help files won't be a prob. But thanks anyway. Although it would be nice to know how to do it. |
I am a little confused by your post. Do you wish to open a html file or do you wish to view the Compiled Help file (.chm) in linux. .chm is the format used by windows for the help files.
You can use xchm to read .chm files in linux http://xchm.sourceforge.net/ |
No, I want to open an HTML file and Linux should open the user-defined WebBrowser.
Its mainly for help files. I don't want to open chm files. I'm just wondering if one can call a function in Linux that can do this in C++. |
Quote:
|
Ok, but lets say that I'm in KDE, will it open up in conquerer or if in Gnome, in whatever browser gnome uses.
Thats actually what I meant, sorry. But ok, if its not possible, do you have an idea of how it can be done? |
Quote:
|
Quote:
At any rate, in KDE can just say "open this file in the default application." You can do it from the command line like so: Code:
kfmclient exec /path/to/file |
Quote:
I got the KDE one to work, but I need to be able to find a way to do this on more distributions then just the ones that use KDE. Thanks for any hints |
All times are GMT -5. The time now is 07:26 AM. |