1.头文件及主函数
#include <windows.h>
#include <tchar.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInstance, char* IpCndLine, int nShowCnd)
{
return 0;
}
2.MessageBox函数
MessageBox(NULL, _T(“苏苏!”), _T(“提示”), MB_OK);
3.URLDownloadToFile函数
用来下载文件
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPreInstance, LPTSTR IpCndLine, int nShowCnd)
{
HRESULT h = URLDownloadToFile(NULL, _T("https://s.cctry.com/images/eagle2.png"), _T("d:\\12345.png"), 0, NULL);
if (h == S_OK) //判断是否下载成功
{
MessageBox(NULL, _T("下载成功!"), _T("提示"), MB_OK);
}
else
{
MessageBox(NULL, _T("下载失败!"), _T("提示"), MB_OK);
}
return 0;
}