在 Windows XP 和 Vista 中,可以一眼就了解每个应用程序的任务栏分组实例/打开的窗口的数量:
由于某种原因Windows 7 中已删除该功能。有没有办法以某种方式重新激活它,即使它需要第三方软件?
答案1
答案2
在听了 Karan 的回答后,我觉得这现在有点没用了,但是花了一些时间之后,我还是决定分享它。
如前所述,满足需求的最佳方式是使用一个应用程序来“增强”Windows 7 任务栏,使分组窗口的数量仅在相关图标内显示,但似乎还没有这样的应用程序,所以我想自己创建一个。好吧,我认为在这种情况下应该使用的语言应该是 MS C++ .NET(我猜 C# 也不适合这个目的……)而且由于我现在的技能还不足以实现这一点(而且我认为我也没有时间去实现),我为了获得一种满足我需求的“可接受”解决方案所做的事情就是修改这个 AHK 脚本如下:
;;WARNING NOTE 1: does't count grouped open folders
;;WARNING NOTE 2: opened Windows Media Player counts as 4 instances
;;WARNING NOTE 3: count fails in the remote hypothesis that, for example, a folder named ".pdf - Adobe Reader" is open
;; based on http://www.autohotkey.com/board/topic/35867-winget-count-is-telling-me-i-have-6-windows-open-but/
#SingleInstance, force
Gui, add, text, , Windows count (including not grouped ones) =
Gui, add, text, x+5 vcount, XX
Gui, add, edit, xm r20 vWList w400 -wrap +0x100000 +readonly
Gui, Show
GoSub, checklist
SetTimer, checklist, 3000
return
checklist:
WinGet, count, count
WinGet,current,List
nocount = 0
last_app_name = %A_Space%- %A_Tab% ; something that surely can't be used for files/folders file... Tip: anyway "Start" should always be the first element of the list
myArray := Object()
log = grouped applications instances:
loop, %current% {
WinGetTitle, tTitle, % "ahk_id " current%A_Index%
if tTitle is space
{
nocount += 1
}
else if (tTitle == A_ScriptName || tTitle == "Start" || tTitle == "Program Manager" || tTitle == "Default IME" || tTitle == "HTA Test" || tTitle = "C:\Windows\system32\cmd.exe") ; note == for everything except = path as case may vary on different PCs
{
nocount += 1
}
else
{
temp_FoundP := InStr(tTitle, last_app_name, 0)
if ((temp_FoundP != 0 ) && (last_app_name == substr(tTitle, temp_FoundP) ))
{
myArray[last_app_name] += 1
}
else
{
temp_FoundP := InStr(tTitle, " - ", 0)
if (temp_FoundP != 0) {
last_app_name := substr(tTitle, temp_FoundP)
}
else {
last_app_name = %A_Space%- %A_Tab%
}
if myArray[last_app_name] {
myArray[last_app_name] += 1
}
else { myArray[last_app_name] := 1
}
}
}
}
remaindercount = 0
For key, value in myArray
{
;MsgBox %key% = %value% ; DELETE THIS LINE
if (key == "-" || value == 1) {
remaindercount += value
}
else {
log .= "`n" key " = " value
}
}
if remaindercount > 0
log .= "`n(remaining = " remaindercount ")"
; Sort, log, C ; uncomment this to sort by name
count -= nocount
GuiControl, , count, %count%
GuiControl, , WList, %log%
return
GuiClose:
ExitApp
最后说明:这是我第一次使用 AHK,而且我总是很匆忙,所以我的编码可能不是“最佳”的,也没有经过充分测试……除此之外,还有一些限制(阅读警告说明)。无论如何,正如所说,我认为在 Karan 回答之后(我接受为解决方案),这不再有用,但任何人如果能够提出更方便的方法/解决方案(例如,另一个类似的应用程序或使用比 AHK“更严肃”的编程语言进行编码……好吧,好吧,也许这更多的是 stackoverflow 问题),仍然欢迎。非常感谢。