; 获取并设置Bing壁纸函数
GetAndSetBingWallpaper:
; 获取Bing壁纸的URL
URLDownload := "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1"
; 发送HTTP请求获取JSON数据
UrlDownloadToFile, % URLDownload, bing.json
; 解析JSON数据,提取壁纸URL
FileRead, BingData, bing.json
ImageURL := RegExReplace(BingData, ".*""url"":""([^""]*).*", "$1")
; 下载壁纸图片
URLDownload := "https://www.bing.com" . ImageURL
UrlDownloadToFile, % URLDownload, bing_wallpaper.jpg
; 设置壁纸
DllCall("SystemParametersInfo", "UInt", 0x0014, "UInt", 0, "Str", A_WorkingDir . "\bing_wallpaper.jpg", "UInt", 2)
FileDelete, bing.json
; FileDelete, bing_wallpaper.jpg
return