#include <GUIToolbar.au3>
#NoTrayIcon
$g_szVersion = "jianshechengxu"
If WinExists($g_szVersion) Then
;MsgBox(16, "温馨提示", "程序已运行",3)
Exit
EndIf
AutoItWinSetTitle($g_szVersion)
Dim $qqini=@ScriptDir&"\Temp.ini"
If FileExists($qqini) Then FileDelete($qqini)
If Not ProcessExists("qq.exe") Then
IniWrite($qqini,"Temp","Number","0")
IniWrite($qqini,"Temp","date","查询失败")
Exit
EndIf
QQInfo()
$var=IniReadSectionNames($qqini)
IniWrite($qqini,"Temp","Number",$var[0])
If $var[0]=1 Then
$fg=StringSplit(IniRead($qqini,"1","1",""),"<~!@#$>",1)
If $fg[2]="" Then
IniWrite($qqini,"1","1",$fg[1]&"<~!@#$>空昵称")
EndIf
Else
For $i=1 To $var[0]
$fg=StringSplit(IniRead($qqini,$var[$i],$var[$i],""),"<~!@#$>",1)
If $fg[2]="" Then
IniWrite($qqini,$var[$i],$var[$i],$fg[1]&"<~!@#$>空昵称")
EndIf
Next
EndIf
;#cs
For $i=1 To $var[0]
$j = IniRead($qqini, "Temp","date","")
If $i = 1 Then IniWrite($qqini, "Temp","date", IniRead($qqini,$var[$i],$var[$i],""))
If $i > 1 Then IniWrite($qqini, "Temp","date", $j & "[~!@#$]" &IniRead($qqini,$var[$i],$var[$i],""))
Next
For $d =$var[0] To 1 Step -1
IniDelete($qqini,$var[$d])
Next
;#ce
Func QQInfo()
Local $info[1][2], $sR, $i, $i_C, $txt
Local $hTb = ControlGetHandle('[class:Shell_TrayWnd]', '', 'ToolbarWindow321')
For $i = 0 To _GUICtrlToolbar_ButtonCount($hTb) - 1
$i_C = _GUICtrlToolbar_IndexToCommand($hTb, $i)
$txt = _GUICtrlToolbar_GetButtonText($hTb, $i_C)
$sR = StringRegExp($txt, '^QQ\:\h(.+)\((\d{5,}|.+@.+)\)', 3)
If Not @error Then
$info[0][0] += 1
ReDim $info[$info[0][0] + 1][2]
$info[$info[0][0]][0] = $sR[1]
$info[$info[0][0]][1] = $sR[0]
IniWrite($qqini,$info[0][0],$info[0][0],$sR[1]&"<~!@#$>"&$sR[0])
EndIf
Next
Return $info
EndFunc ;==>QQInfo