#include <Windows.h>
#include <stdio.h>
#define IE L"iexplore.exe"
#define URL L"http://www.baidu.com/"
int main()
{
HINSTANCE hInstance;
hInstance = ShellExecute(NULL, L"open", URL, NULL, NULL, SW_HIDE);
//hInstance = ShellExecute(NULL, L"open", IE, URL, NULL, SW_HIDE);
if (!hInstance) {
wprintf(L"ShellExecute error:%d\n", GetLastError());
return 0;
}
CloseHandle(hInstance);
return 0;
}
如果装了360和迅雷,用注释掉的那一行运行,则可能出现警报。