CString strURL = _T("http://blog.csdn.net/jiangdong2007");
if (::ShellExecute(NULL, NULL, strURL, NULL, NULL, SW_SHOWNORMAL) <(HINSTANCE) 32)
{
TRACE(_T("Can't open URL: %s\n"), strURL);
}
static BOOL __stdcall ShellExecute(LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters = NULL, LPCTSTR lpDirectory = NULL, UINT nShow = SW_SHOWNORMAL)
{
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.fMask = SEE_MASK_NOCLOSEPROCESS;
sei.hwnd = NULL;
sei.lpVerb = lpOperation;
sei.lpFile = lpFile;
sei.lpParameters = lpParameters;
sei.lpDirectory = lpDirectory;
sei.nShow = nShow;
sei.hInstApp = NULL;
return ::ShellExecuteEx(&sei);
}
如果通过ShellExecute打开一个连接
最新推荐文章于 2023-01-27 14:04:12 发布