循环激活除最小化以外的窗口

;~ SciTEWindow	C:UsersguoDesktop激活窗口.ahk - SciTE4AutoHotkey [2 of 5]
;~ ThunderRT6Main	Rolan
;~ CabinetWClass	D:portableSoftAutoHotkey脚本tool
;~ 条件多的窗口热键应放在条件少的窗口前面。
;实现功能:实现类似于altdrag的循环激活除最小化以外的窗口

k:=1
f12::
	;~ #j::
	;~ DetectHiddenWindows, Off
	SetTitleMatchMode RegEx
	WinGet, id, list,,,Rolan,Program Manager|WorkerW
	clas := [],title:=[]
	chuangti=
	Loop, %id%
	{
		this_id := id%A_Index%
		WinGetClass, this_class, ahk_id %this_id%
		WinGetTitle, this_title, ahk_id %this_id%
		;~ chuangti.=this_class a_tab this_title "`n"
		WinGet,zt,minmax,ahk_id %this_id%
		;~ msgbox %zt%
		;WinActivate, ahk_id %this_id%
		if (zt=-1 or zt=)  ;去掉最小化和参数为0的
			continue
		else if !this_title    ;去掉没有标题的
			continue
		else
		{
			title.Insert(this_title)
			clas.Insert(this_class)
			;~ tt%ArrayCount% := this_title  ; 把此行保存到数组中的下一个元素.
			;~ Array%ArrayCount% := this_class  ; 把此行保存到数组中的下一个元素.
			chuangti.=this_class a_tab this_title "`n"
		}
	}
	Clipboard:=chuangti
	;~ k:= k=6 ? 1 : k
	num=% title._MaxIndex()
	;~ MsgBox %num%
	k:= k=%num% ? 1 : k
	MsgBox % title[k]
	;~ MsgBox % clas[k]
	;~ WinActivate,% tt%A_Index% "ahk_class" .  Array%A_Index%
	;~ WinActivate,% title[k] A_Space "ahk_class" .  clas[k]
	;~ WinActivate,% title[k]
	WinActivate,% "ahk_class" .  clas[k]
	k++
return


/*  ;妖的代码,循环激活数组内容,按一次热键激活下一个
k:=1
arr:=["a","b","c","d","e"]
F1::
	k:= k=6 ? 1 : k
	MsgBox % arr[k]
	k++
	return
*/
/*
loop,%ArrayCount%   ;激活这些窗口
{
element := Array%A_Index%
WinActivate,% tt%A_Index% "ahk_class" .  Array%A_Index%
;~ MsgBox,% tt%A_Index%
;~ MsgBox,% Array%A_Index%
;~ MsgBox % "Element number " . A_Index . " is " . Array%A_Index%

}
return
*/

给TA捐赠
共{{data.count}}人
人已捐赠
其他

彩色LV

2020-3-9 2:30:44

其他

循环读取

2020-3-9 2:32:44

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索