amazing little code, I modified it a bit so I could parse the information correctly, because tooltip information contains a new line so i cant parse by newline... corrected code is here:
Code:
If !sExeName || (sExeName = sProcess) || (sExeName = pid)
VarSetCapacity(sTooltip,128), VarSetCapacity(wTooltip,128*2)
, DllCall("ReadProcessMemory", "Uint", hProc, "Uint", iString, "Uint", &wTooltip, "Uint", 128*2, "Uint", 0)
, DllCall("WideCharToMultiByte", "Uint", 0, "Uint", 0, "str", wTooltip, "int", -1, "str", sTooltip, "int", 128, "Uint", 0, "Uint", 0)
, sTrayIcons .= "idx: " . A_Index-1 . " | idn: " . idn . " | Pid: " . pid . " | uID: " . uID . " | MessageID: " . nMsg . " | hWnd: " . hWnd . " | Class: " . sClass . " | Process: " . sProcess . " | Tooltip: " . sTooltip . "|`n"
}
it allows you to do something like this:
Code:
tIcons := TrayIcons()
Loop, Parse, tIcons, |
{
if a_loopfield contains idx:
icon .= a_loopfield " | "
if a_loopfield contains process:
icon .= a_loopfield "`n"
}
msgbox % icon
Quote:
---------------------------
TrayIcon.ahk
---------------------------
idx: 0 | Process: AutoHotkey.exe
idx: 1 | Process: TSNotifier.exe
idx: 2 | Process: Azureus.exe
idx: 3 | Process: winamp.exe
idx: 4 | Process: Skype.exe
idx: 5 | Process: explorer.exe
idx: 6 | Process: DTLite.exe
idx: 7 | Process: TeamViewer.exe
idx: 8 | Process: procexp.exe
idx: 9 | Process: hamachi-2-ui.exe
idx: 10 | Process: AutoHotkey.exe
idx: 11 | Process: xnViewer.exe
idx: 12 | Process: Dropbox.exe
idx: 13 | Process: explorer.exe
idx: 14 | Process: explorer.exe
idx: 15 | Process: explorer.exe
idx: 16 | Process: explorer.exe
idx: 17 | Process: explorer.exe
idx: 18 | Process: rundll32.exe
---------------------------
OK
---------------------------
That can be use to create a script that might list the current programs that contain icons in a GUI (something that i am doing at the moment) or something similar ...
