C++ 调用默认浏览器 打开指定网址

#include <windows.h>
#include <tchar.h>
#include <assert.h>
#include <shellapi.h>
 
const TCHAR szOperation[] = _T("open");
const TCHAR szURL[] = _T("https://www.qq.com/");
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR lpCmd, int
	nShow)
{
	HINSTANCE hRslt = ShellExecute(NULL, szOperation,
		szURL, NULL, NULL, SW_SHOWNORMAL);
 
	assert(hRslt > (HINSTANCE)HINSTANCE_ERROR);
 
	return 0;
}

猜你喜欢

转载自blog.csdn.net/u012422855/article/details/84396883
今日推荐