#IfWinActive,贴吧世界
return
f1::
if (xh){
xh=0
}else{
xh++
}
if xh=0
ControlGet,AHK_ID,Hwnd ,,,%窗口名%
if xh=1
ControlGet,AHK_ID2,Hwnd ,,,%窗口名%
MsgBox,窗口1ID=%AHK_ID%窗口2ID=%AHK_ID2%
return
w::
ControlSend,ahk_parent,{w Down},ahk_id %AHK_ID2%
ControlSend,ahk_parent,{w Down},ahk_id %AHK_ID%
KeyWait,w
ControlSend,ahk_parent,{w up},ahk_id %AHK_ID2%
ControlSend,ahk_parent,{w up},ahk_id %AHK_ID%
return
原作者 @wo小熊o
这位大佬写的,然后可以2个窗口多开,我在基础上加的数字,但是每次还是只能控制2个窗口。不知道是哪里错误了呢?
#IfWinActive,魔兽世界
return
f1::
if (xh){
xh=0
}else{
xh++
}
if xh=0
ControlGet,AHK_ID,Hwnd ,,,%魔兽世界%
if xh=1
ControlGet,AHK_ID2,Hwnd ,,,%魔兽世界%
if xh=2
ControlGet,AHK_ID3,Hwnd ,,,%魔兽世界%
if xh=3
ControlGet,AHK_ID4,Hwnd ,,,%魔兽世界%
if xh=4
ControlGet,AHK_ID5,Hwnd ,,,%魔兽世界%
MsgBox,窗口1ID=%AHK_ID%窗口2ID=%AHK_ID2%窗口3ID=%AHK_ID3%窗口4ID=%AHK_ID4%窗口5ID=%AHK_ID5%
return
1::
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID5%
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID4%
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID3%
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID2%
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID%
KeyWait,1
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID5%
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID4%
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID3%
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID2%
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID%
return
return
f1::
if (xh){
xh=0
}else{
xh++
}
if xh=0
ControlGet,AHK_ID,Hwnd ,,,%窗口名%
if xh=1
ControlGet,AHK_ID2,Hwnd ,,,%窗口名%
MsgBox,窗口1ID=%AHK_ID%窗口2ID=%AHK_ID2%
return
w::
ControlSend,ahk_parent,{w Down},ahk_id %AHK_ID2%
ControlSend,ahk_parent,{w Down},ahk_id %AHK_ID%
KeyWait,w
ControlSend,ahk_parent,{w up},ahk_id %AHK_ID2%
ControlSend,ahk_parent,{w up},ahk_id %AHK_ID%
return
原作者 @wo小熊o
这位大佬写的,然后可以2个窗口多开,我在基础上加的数字,但是每次还是只能控制2个窗口。不知道是哪里错误了呢?
#IfWinActive,魔兽世界
return
f1::
if (xh){
xh=0
}else{
xh++
}
if xh=0
ControlGet,AHK_ID,Hwnd ,,,%魔兽世界%
if xh=1
ControlGet,AHK_ID2,Hwnd ,,,%魔兽世界%
if xh=2
ControlGet,AHK_ID3,Hwnd ,,,%魔兽世界%
if xh=3
ControlGet,AHK_ID4,Hwnd ,,,%魔兽世界%
if xh=4
ControlGet,AHK_ID5,Hwnd ,,,%魔兽世界%
MsgBox,窗口1ID=%AHK_ID%窗口2ID=%AHK_ID2%窗口3ID=%AHK_ID3%窗口4ID=%AHK_ID4%窗口5ID=%AHK_ID5%
return
1::
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID5%
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID4%
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID3%
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID2%
ControlSend,ahk_parent,{1 Down},ahk_id %AHK_ID%
KeyWait,1
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID5%
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID4%
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID3%
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID2%
ControlSend,ahk_parent,{1 up},ahk_id %AHK_ID%
return
