bool OpenUrl(std::wstring& url_, OPEN_BROWSER_TYPE browser_type = OPEN_BY_DEFALUT_BROWSER )
{
// 如果使用IE打开的话
if (browser_type == OPEN_BY_IE)
{
HINSTANCE hRet = ::ShellExecuteW(NULL, L"open", L"iexplore.exe", url_.c_str(), NULL, SW_SHOW);
if ((int)hRet>32)
{
return true;
}
return false;
}
else{
SHELLEXECUTEINFOW shelli = { 0 };
shelli.cbSize = sizeof(SHELLEXECUTEINFOW);
shelli.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;
shelli.lpVerb = L"open";
shelli.lpFile = url_.c_str();
shelli.nShow = SW_SHOW;
if (::ShellExecuteExW(&shelli))
{
return true;
}
return false;
}
return true;
}