开发者

How can i jump to a webpages anchor <a> tag using ShellExecute in C++?

I'm currently opening a webpage succesfully in this manner, for example

ShellExecute(NULL, "open", "http://www.google.com", NULL, NULL, SW_SHOWNORMAL);

However what I really need to do is be able to jump to an anchor tag, like 'mypage.html#middle'. When I just append it to the end of the URL 开发者_开发知识库string, the webpage only opens at the file specified, and won't jump to the tag, nor will it be in the address bar.

Thanks.


Okay, so I've managed to achieve this using a slightly different technique. However when using this method you have to define which browser to open it with, which might be considered an issue for those concerned about deploying it to a large number of users (fortunately, in my case this isn't true).

ShellExecute(NULL, "open", "iexplore", urlString, NULL, SW_SHOWNORMAL);

Where 'urlString' is the web address, with the anchor at the end.

Thanks all.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜