I am using this line to open a .htm file in default application:
This is all very well, it works, except for one of the guys who tested it has associated Notepad++ with htm files. Grrr.
So I need to cater for these events, and open the htm file in the default browser, whether or not htm files are associated with a browser.
I figured the way to do it was detect the default browser and pass that as a string to my line above, using the method as mentioned in this current thread:
So, I found this method of detecting browser:
but this seems an enormous extra amount of code.
Is there an easier way for me to open my htm file in the default browser?
(I did check out the FAQs How do I execute another program from my Delphi application 1 & 2, but couldn't deduce any answers from those)
Steve (Delphi 2007 & XP)
Code:
ShellExecute(Handle, 'open', 'F:\my_path\my_file.htm', nil, nil, SW_SHOWNORMAL) ;
This is all very well, it works, except for one of the guys who tested it has associated Notepad++ with htm files. Grrr.
So I need to cater for these events, and open the htm file in the default browser, whether or not htm files are associated with a browser.
I figured the way to do it was detect the default browser and pass that as a string to my line above, using the method as mentioned in this current thread:
So, I found this method of detecting browser:
but this seems an enormous extra amount of code.
Is there an easier way for me to open my htm file in the default browser?
(I did check out the FAQs How do I execute another program from my Delphi application 1 & 2, but couldn't deduce any answers from those)
Steve (Delphi 2007 & XP)