Aenfa wrote:I have tested it in Windows 10 and have found the library in the first post only sees visible icons while the library at post
https://autohotkey.com/boards/viewtopic ... 9186#p9186 only sees hidden icons.
Using Windows 10 v 1709 build 16299.64 and AHK 1.1.26.01
Thank you,
Aenfa, for your testing and reporting.
Vince42 wrote:Maybe there will be a "universal" version of TrayIcon, which would a) display visible and hidden icons and b) deliver information about the state of visibility in the future - I will try it again, as soon as I get all my SysTray icons listed.
it would also be cool, if the system icons like network connection, battery, sound, language and clock would be clickable as well.
I've made a change to the library's code and put it up on
Github, but I'll post it here, too:
Hopefully, this should work for both the hidden and the visible tray icons. Once you have the newest TrayIcon.ahk in one of your library locations, try this code that should list all of your tray icons, both visible and hidden:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
; This script assumes that TrayIcon.ahk is in one of your library locations:
; %A_ScriptDir%\Lib\ ; Local library - requires v1.0.90+.
; %A_MyDocuments%\AutoHotkey\Lib\ ; User library.
; path-to-the-currently-running-AutoHotkey.exe\Lib\ ; Standard library.
; If not in any of those, then add an #Include at the top pointing to the file.
; Create a ListView to display the list of info gathered
Gui Add, ListView, Grid r30 w700 Sort, Process|Tooltip|Visible|Handle
; Get all of the icons in the system tray using Sean's TrayIcon library
oIcons := TrayIcon_GetInfo()
; Loop through the info we obtained and add it to the ListView
Loop, % oIcons.MaxIndex()
{
proc := oIcons[A_Index].Process
ttip := oIcons[A_Index].tooltip
tray := oIcons[A_Index].Tray
hWnd := oIcons[A_Index].hWnd
vis := (tray == "Shell_TrayWnd") ? "Yes" : "No"
LV_Add(, proc, ttip, vis, hWnd)
}
LV_ModifyCol()
LV_ModifyCol(3, "AutoHdr") ; Auto-size the 3rd column, taking into account the header's text
Gui Show, Center, System Tray Icons
Return
GuiEscape:
GuiClose:
ExitApp