运行环境:分辨率:1366×768 色深:32位 操作系统:Windows 7 Ultimate 按键精灵版本:9.10.10413
Dim MyArray //--------------选择照片------------------- PicPath = 取照片路径() If PicPath = "" Then MsgBox "请选择图片格式[jpg,bmp,gif,png]", 64 EndScript End If //----------打开我的资料---------------- Hwnd1 = Plugin.Window.Find("TXGuiFoundation", "QQ2011") If Hwnd1 = 0 Then MsgBox "QQ没有运行或QQ版本不是2011", 64 EndScript End If Call Plugin.Bkgnd.LeftClick(Hwnd1, 27, 53) Delay 500 //-----------打开更换头像--------------- Hwnd2 = Plugin.Window.Find("TXGuiFoundation", "我的资料") Call Plugin.Bkgnd.LeftClick(Hwnd2, 65, 65) Delay 500 //----------打开本地照片对话框---------------- Hwnd3 = Plugin.Window.Find("TXGuiFoundation", "更换头像") Call Plugin.Bkgnd.LeftClick(Hwnd3, 65, 75) Delay 500 //---------------------------------------- SayString PicPath Delay 500 KeyPress 13, 1 Delay 500 Call Plugin.Bkgnd.LeftClick(Hwnd3, 443, 430) Delay 500 Do Hwnd3 = Plugin.Window.Find("TXGuiFoundation", "更换头像") If Hwnd3 = 0 Then Exit Do End If Delay 500 Loop Call Plugin.Bkgnd.LeftClick(Hwnd2, 565, 9) Delay 500 '-----------------函数--------------------- Function 取照片路径() 图片格式 = Array("jpg", "bmp", "gif", "png") //----------打开对话框---------------- Path = Plugin.File.SelectFile() If Path = "" Then EndScript End If suffix = LCase(取后缀(Path)) //--------------判断是不是图片------------------ For i = 0 To UBound(图片格式) //TracePrint 图片格式(i) If suffix <> 图片格式(i) Then j = j + 1 End If Next If j <> 3 Then // MsgBox "请选择图片文件!", 64 取照片路径 = "" Else 取照片路径 = Path End If End Function Function 取后缀(Path) MyPos = InStrRev(Path, ".") If MyPos = 0 Then 取后缀 = "" Else 取后缀 = Right(Path, Len(Path) - MyPos) End If End Function
按键精灵更换app头像