回复 5# qq271859852
怎么会呢,你加在哪儿啊;如下,在循环里加上SendKeepActive("QQ2011"),其他未动你的,你再试试
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ProgressConstants.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ListBoxConstants.au3>
#include <GuiListView.au3>
#include <File.au3>
#include <Array.au3>
#region ### START Koda GUI section ### Form=
;~ 创建主界面
$Form1 = GUICreate("QQ批量登录工具", 473, 355, 192, 124)
$ListView1 = GUICtrlCreateListView("", 8, 8, 449, 305, _
BitOR($GUI_SS_DEFAULT_LISTVIEW, _
$WS_HSCROLL, $WS_VSCROLL), _
BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, _
$LVS_EX_CHECKBOXES))
$Button1 = GUICtrlCreateButton("登 录", 96, 320, 81, 25)
$Button2 = GUICtrlCreateButton("使用说明", 257, 320, 81, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
Local $j
;~ For $j = 0 To 9
;~ IniWrite(@ScriptDir & "\自动登陆配置信息.ini", $j, "QQ号", "")
IniWrite(@ScriptDir & "\自动登陆配置信息.ini", $j, "密码", "")
;~ Next
;~ 书写配置文件,填写入QQ号码与密码
_Main()
Func _Main();~ 主函数
_GUICtrlListView_AddColumn($ListView1, "QQ号码", 140)
_GUICtrlListView_AddColumn($ListView1, "密码", 140)
Local $i
Local $QQDate[10][3];定义二维数组$QQDate储存QQ帐和密码等信息
For $i = 0 To 9
$QQDate[$i][1] = IniRead(@ScriptDir & "\自动登陆配置信息.ini", $i, "QQ号", "")
$QQDate[$i][2] = IniRead(@ScriptDir & "\自动登陆配置信息.ini", $i, "密码", "")
Next;读取配置信息
If IsArray($QQDate) Then
_GUICtrlListView_BeginUpdate($ListView1)
_GUICtrlListView_DeleteAllItems($ListView1)
For $i = 0 To 9
GUICtrlCreateListViewItem($QQDate[$i][1] & "|" & $QQDate[$i][2], $ListView1)
Next
_GUICtrlListView_EndUpdate($ListView1)
EndIf;根据配置文件信息创建ListView列表
For $i = 0 To 9
If Not $QQDate[$i][1] = "" Or Not $QQDate[$i][2] = "" Then
_GUICtrlListView_SetItemChecked($ListView1, $i)
EndIf
Next;设置QQ号和密码都不为空的项为“选中“状态
While 1;开启循环模式
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1;单击登录
For $i = 0 To 9
If _GUICtrlListView_GetItemChecked($ListView1, $i) Then;如果选中,则运行QQ,并填入相应的QQ号码与密码
Run("D:\Program Files\Tencent\QQ\Bin\QQ.exe")
WinWait("QQ2011")
WinActivate("QQ2011")
SendKeepActive("QQ2011");我就加了这句
Sleep(250)
ControlSend("QQ2011", "", "TXEdit1", $QQDate[$i][1])
Sleep(250)
ControlClick("QQ2011", "N", "[CLASS:Edit; INSTANCE:1]", "left")
Sleep(250)
Send($QQDate[$i][2])
Sleep(250)
Send("{enter}")
Sleep(3000)
EndIf;登录
Next
EndSwitch
WEnd
EndFunc ;==>_Main
|