1 #include <Windows.h> 2 #include <tchar.h> 3 4 int WINAPI _tWinMain(HINSTANCE hInstance, 5 HINSTANCE hPrevInstance, 6 LPTSTR lpCmdLine, 7 int nCmdShow) 8 { 9 ShellExecute(NULL,_T("open"),_T("www.baidu.com"),NULL,NULL,SW_SHOWNORMAL); 10 //打開百度 11 ShellExecute(NULL,_T("open"),_T("D:\\1.txt"),NULL,NULL,SW_SHOWNORMAL); 12 //打開目錄 13 ShellExecute(NULL,L"open", L"mailto:", NULL, NULL, SW_SHOWNORMAL); 14 ShellExecute(NULL,_T("open"),_T("mailto:12345@qq.com"), NULL, NULL, SW_SHOWNORMAL); 15 //打開郵箱 16 17 return 0; 18 }