开发者

opening a URL in new tab

开发者 https://www.devze.com 2022-12-26 00:08 出处:网络
Is there a way to open a URL in a new tab (in IE) from a cpp applicat开发者_开发知识库ion without using DDE or shell execute ??In general, you want to do something like this (error checking excluded t

Is there a way to open a URL in a new tab (in IE) from a cpp applicat开发者_开发知识库ion without using DDE or shell execute ??


In general, you want to do something like this (error checking excluded to save me typing):

CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER, IID_IWebBrowser2, (void**)&browser); 
browser->Navigate(bstrURL, &vEmpty, &vEmpty, &vEmpty, &vEmpty);
browser->put_Visible(VARIANT_TRUE); 


You need just to send command to shell:

shell "explorer.exe %site_path%"

This should open IE with new tab and your site.

0

精彩评论

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