您的位置:首页 > 运维架构 > Shell

使用ShellExecute函数打开IE浏览器下的新窗口

2017-08-22 18:10 169 查看
HWND OpenWindows(HWND hwnd)

{
LPCTSTR  open = L"open";      //set config
//ShellExecute(hwnd, open, L"iexplore.exe", L"https://hao.360.cn/?a1004", NULL, SW_SHOWNORMAL);
//ShellExecute(hwnd, open, L"http://www.2cto.com/kf/201307/229105.html",NULL, NULL, SW_SHOWNORMAL);

ShellExecute(hwnd,  open,L"C:\\Program Files\\Internet Explorer\\iexplore.exe", NULL, NULL, SW_SHOWMAXIMIZED );//open the first ie explore.
Sleep(500);
HWND hwexp1 = FindWindow(L"IEFrame",NULL); //get the hwnd
for(int i=0;i<5;i++)
ShellExecute(hwexp1, open, L"https://hao.360.cn/?a1004", NULL, NULL, SW_SHOWMAXIMIZED);//get 5 page from the first ie windows.
Sleep(1500);
ShellExecute(hwnd,  open,L"C:\\Program Files\\Internet Explorer\\iexplore.exe", NULL, NULL, SW_SHOWMAXIMIZED );//open the 2nd ie explore.
Sleep(500);
HWND hwexp2 = FindWindow(L"IEFrame",NULL); 
for(int i=0;i<5;i++)
ShellExecute(hwexp2, open, L"https://hao.360.cn/?a1004", NULL, NULL, SW_SHOWMAXIMIZED);//get 5 page from the 2nd ie windows.
return hwexp2;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: