Tob*_*ler 9 windows firefox icons windows-10
我是一个标签囤积者,我承认这一点。但至少我现在已经将它们分类到上下文窗口中,并且我希望 Windows 任务栏中的每个窗口都有不同的图标(不是标签栏,它由 favicon 管理)。如何做到这一点?
举个例子,假设我有一个带有各种 StackExchange 选项卡的窗口,我希望将 StackExchange 徽标作为图标,另一个带有 GitHub 存储库的窗口应该带有 GitHub 徽标,第三个窗口带有特定于项目的选项卡我有一个自定义图标(或只是例如 Firefox 徽标顶部的彩色字母)。
我也接受一种解决方案,该解决方案能够简单地使用每个窗口的第一个选项卡的图标,尽管最好独立于该图标。
创建一个.ahk文本文件并输入以下内容:
#Persistent
SetTitleMatchMode, 2 ; A window's title to contain the text anywhere
F9::
ChangeWindowIcon("title text", "\path\to\iconfile.ico")
ChangeWindowIcon(WinSpec, IconFile) {
hIcon := DllCall("LoadImage", uint, 0, str, IconFile, uint, 1, uint, 0, uint, 0, uint, uint 0x10)
if (!hIcon) {
MsgBox, "Icon file missing or invalid in `nChangeWindowIcon(" IconFile ", " WinSpec ")`n`n"
Throw "Icon file missing or invalid in `nChangeWindowIcon(" IconFile ", " WinSpec ")`n`n"
}
hWnd := WinExist(WinSpec)
if (!hWnd) {
MsgBox, Window Not Found
return "Window Not Found"
}
SendMessage, WM_SETICON:=0x80, ICON_SMALL:=0, hIcon,, ahk_id %hWnd% ; Set the window's small icon
SendMessage, WM_SETICON:=0x80, ICON_BIG:=1, hIcon,, ahk_id %hWnd% ; Set the window's big icon
SendMessage, WM_SETICON:=0x80, ICON_SMALL2:=2, hIcon,, ahk_id %hWnd% ; Set the window's small icon
}
Run Code Online (Sandbox Code Playgroud)
该脚本设置为在点击 时激活F9,但您可以设置自己的密钥。根据需要添加对函数的多次调用ChangeWindowIcon,每个调用都具有以下参数:
当脚本运行时,您可以右键单击托盘栏中的绿色 H 图标,然后选择“退出”来终止。如果它有效,您还可以将其添加到您的启动组中,以便在登录时运行。
请注意,AutoHotkey 还可以启动您最喜欢的选项卡并在屏幕上排列它们的布局。AutoHotkey 确实没有什么做不到的。
| 归档时间: |
|
| 查看次数: |
498 次 |
| 最近记录: |