微信多开2.0--增加自动排列窗口功能
IniRead, bit, myfile.ini, section, key_bit
IniRead, times, myfile.ini, section, key_times
SetRegView %bit%
RegRead, OutputVar2, HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\WeChat, InstallLocation
Loop, %times% {
Run, %comspec% /c `start /d %OutputVar2% WeChat.exe
}
WinWait, 微信, , 10
Sleep,5000
WinGet, id, List ,微信 ;窗口标题
idlist := []
loop, %id%{
idlist.Push(id%A_Index%)
}
/*
for k,v in idlist{
MsgBox %v%
}
*/
FirstID := idlist[1]
;MsgBox % FirstID
;MsgBox %X% %Y% %Width% %Height%
WinMove, ahk_id %FirstID%,,0,0
WinGetPos, X, Y, Width, Height, ahk_id %FirstID%
idlist.Delete(1)
/*
for k,v in idlist{
MsgBox %v%
}
*/
SysGet, VirtualWidth, 78
i := 1
for k,v in idlist{
if (i != Floor(Number_of_windows)){
Number_of_windows := VirtualWidth/Width
;MsgBox % Floor(Number_of_windows)
X1 := Width + X
WinMove, ahk_id %v%,,%X1%,%Y%
WinGetPos, X, Y, Width, Height, ahk_id %v%
i += 1
;MsgBox %i% %Y%
}
else if (i = Floor(Number_of_windows)){
Number_of_windows := VirtualWidth/Width
;MsgBox % Floor(Number_of_windows)
X1 := 0
Y := 475
WinMove, ahk_id %v%,,%X1%,%Y%
WinGetPos, X, Y, Width, Height, ahk_id %v%
i += 1
;MsgBox %i% %Y%
}
}
ExitApp
配置文件,粘贴进记事本保存为“”myfile.ini“”,与上面的脚本放在同级目录
[section]
多少位的微信,32位就改成32
key_bit = 64
开几个微信,3个就改成3
key_times = 10