ShellExecute a local html-file
-
Hi Is it possible to open a html-file at a given anchor-point using ShellExecute? Or should I use another method? I tried to use the following argument to ShellExecute open
file://C:/afile.htm#alocation
and the file opens, but always from the top. drives me crazy tia -
Hi Is it possible to open a html-file at a given anchor-point using ShellExecute? Or should I use another method? I tried to use the following argument to ShellExecute open
file://C:/afile.htm#alocation
and the file opens, but always from the top. drives me crazy tia::ShellExecute(NULL, _T("open"), _T("C:\\afile.htm#alocation"), NULL, NULL, SW_SHOWNORMAL);
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
Hi Is it possible to open a html-file at a given anchor-point using ShellExecute? Or should I use another method? I tried to use the following argument to ShellExecute open
file://C:/afile.htm#alocation
and the file opens, but always from the top. drives me crazy tiaThe
file:
URL parsing has changed in IE 7.0 to be stricter. That means you may see differences between IE 6.0 and 7.0. See here[^] for how to properly construct afile:
URL.Stability. What an interesting concept. -- Chris Maunder
-
::ShellExecute(NULL, _T("open"), _T("C:\\afile.htm#alocation"), NULL, NULL, SW_SHOWNORMAL);
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
Niklas Lindquist wrote:
Honestly, you haven't tried that, have you?
yes i did, and you ? :~
Niklas Lindquist wrote:
Do you at all think it will work?
not it will, it does ! :doh:
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
Niklas Lindquist wrote:
Honestly, you haven't tried that, have you?
yes i did, and you ? :~
Niklas Lindquist wrote:
Do you at all think it will work?
not it will, it does ! :doh:
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
I get ERROR_FILE_NOT_FOUND from that. (Which to me seems like a reasonable thing, since the number character is valid in a windows path.) Adding "file://" in front will bring up the correct file, but always shown from the top. Removing "#alocation" also works (in that it brings up the correct file, but not located at the anchor point obviously). WinXP IE6 I still doubt that it works for you. :sigh:
-
I get ERROR_FILE_NOT_FOUND from that. (Which to me seems like a reasonable thing, since the number character is valid in a windows path.) Adding "file://" in front will bring up the correct file, but always shown from the top. Removing "#alocation" also works (in that it brings up the correct file, but not located at the anchor point obviously). WinXP IE6 I still doubt that it works for you. :sigh:
ah, sorry, it was the anchor that matters... have you tried passing te anchor parameter into the "parameters" argument ? like this (this one, i didn't test) :
::ShellExecute(NULL, _T("open"), _T("C:\\afile.htm"), _T("#alocation"), NULL, SW_SHOWNORMAL);
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
ah, sorry, it was the anchor that matters... have you tried passing te anchor parameter into the "parameters" argument ? like this (this one, i didn't test) :
::ShellExecute(NULL, _T("open"), _T("C:\\afile.htm"), _T("#alocation"), NULL, SW_SHOWNORMAL);
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
Been there, done that. Right now it feels like I've tried every single possibility but the right one. Maybe one should use another function altogether? Or is it even impossible, since I'd like it to work with Firefox et al aswell, depending on default browser? I don't want to add browser dependencies to the code.