回复 6# xndo
省掉了 #include <Array.au3>
#include <GUIToolbar.au3>
Local $File = 'qqinfo.txt', $out = ''
$qq = QQInfo()
For $i = 1 To $qq[0][0]
$out &= $qq[$i][0] & ' = ' & $qq[$i][1] & @CRLF
Next
FileWrite($File, $out)
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]
EndIf
Next
Return $info
EndFunc ;==>QQInfo
|