#include <windows.h>
#include <tchar.h>
#include <assert.h>
const TCHAR szOperation[] = _T("open");
const TCHAR szAddress[] = _T("https://www.baidu.com/");
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR lpCmd, int
nShow)
{
HINSTANCE hRslt = ShellExecute(NULL, szOperation,
szAddress, NULL, NULL, SW_SHOWNORMAL);
assert(hRslt > (HINSTANCE)HINSTANCE_ERROR);
return 0;
}C++ 调用默认浏览器 打开指定网址
最新推荐文章于 2025-05-26 11:09:01 发布
本文展示了一个简单的Windows程序示例,该程序通过调用ShellExecute函数来打开指定URL的网页。示例代码包括必要的头文件引入,并展示了如何正确地设置参数以确保网页成功加载。

4764

被折叠的 条评论
为什么被折叠?



