Thanks for the reply.
Strange. When I run the individual scripts on their own, I don't get the ListLines window.
And when I run Startup without any scripts or folders in the menu, I don't get the ListLines window either.
But when I run Startup with a folder reference, but remove all scripts from the folder, I DO get the ListLines window. In that case, the tray icon tool tip shows only itself, and the right click menu has no submenus (which is what I'd expect...?)
Here's what the window is showing when the folder is specified, but contains no scripts:
Then once I hit F5, the levee breaks.
Code: Select all
Script lines most recently executed (oldest first). Press [F5] to refresh. The seconds elapsed between a line and the one after it is in parentheses to the right (if not 0). The bottommost line's elapsed time is the number of seconds since it executed.
---- D:\Dropbox\AHK files\Startup - AutoHotkey v4.ahk
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
193: SendMessage,0x417,A_Index - 1,pRB,ToolbarWindow32%idxTB%,ahk_class %sTray%
194: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, pRB, Ptr, &btn, UInt, szBtn, UInt, 0)
196: iBitmap := NumGet(btn, 0)
197: cmdID := NumGet(btn, 4)
198: statyle := NumGet(btn, 8)
199: dwData := NumGet(btn, (A_Is64bitOS ? 16 : 12))
200: iString := NumGet(btn, (A_Is64bitOS ? 24 : 16))
202: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, dwData, Ptr, &nfo, UInt, szNfo, UInt, 0)
204: hWnd := NumGet(nfo, 0)
205: uID := NumGet(nfo, (A_Is64bitOS ? 8 : 4))
206: msgID := NumGet(nfo, (A_Is64bitOS ? 12 : 8))
207: hIcon := NumGet(nfo, (A_Is64bitOS ? 24 : 20))
209: WinGet,pID,PID,ahk_id %hWnd%
210: WinGet,sProcess,ProcessName,ahk_id %hWnd%
211: WinGetClass,sClass,ahk_id %hWnd%
213: if !sExeName || (sExeName = sProcess) || (sExeName = pID)
215: DllCall("ReadProcessMemory", Ptr, hProc, Ptr, iString, Ptr, &tip, UInt, szTip, UInt, 0)
216: Index := (oTrayIcon_GetInfo.MaxIndex()>0 ? oTrayIcon_GetInfo.MaxIndex()+1 : 1)
217: oTrayIcon_GetInfo[Index,"idx"] := A_Index - 1
218: oTrayIcon_GetInfo[Index,"cmdID"] := cmdID
219: oTrayIcon_GetInfo[Index,"pID"] := pID
220: oTrayIcon_GetInfo[Index,"uID"] := uID
221: oTrayIcon_GetInfo[Index,"msgID"] := msgID
222: oTrayIcon_GetInfo[Index,"hIcon"] := hIcon
223: oTrayIcon_GetInfo[Index,"hWnd"] := hWnd
224: oTrayIcon_GetInfo[Index,"Class"] := sClass
225: oTrayIcon_GetInfo[Index,"Process"] := sProcess
226: oTrayIcon_GetInfo[Index,"Tooltip"] := StrGet(&tip, "UTF-16")
227: oTrayIcon_GetInfo[Index,"Tray"] := sTray
228: }
229: }
230: DllCall("VirtualFreeEx", "Uint", hProc, "Uint", pProc, "Uint", 0, "Uint", 0x8000)
231: DllCall("CloseHandle", "Uint", hProc)
232: }
179: idxTB := TrayIcon_GetTrayBar()
239: Setting_A_DetectHiddenWindows := A_DetectHiddenWindows
240: DetectHiddenWindows,On
241: WinGet,ControlList,ControlList,ahk_class Shell_TrayWnd
242: RegExMatch(ControlList, "(?<=ToolbarWindow32)\d+(?!.*ToolbarWindow32)", nTB)
243: Loop,%nTB%
245: ControlGet,hWnd,hWnd,,ToolbarWindow32%A_Index%,ahk_class Shell_TrayWnd
246: hParent := DllCall( "GetParent", Ptr, hWnd )
247: WinGetClass,sClass,ahk_id %hParent%
248: if (sClass <> "SysPager")
250: idxTB := A_Index
251: Break
253: DetectHiddenWindows,%Setting_A_DetectHiddenWindows%
254: Return,idxTB
180: WinGet,pidTaskbar,PID,ahk_class %sTray%
182: hProc := DllCall("OpenProcess", UInt, 0x38, Int, 0, UInt, pidTaskbar)
183: pRB := DllCall("VirtualAllocEx", Ptr, hProc, Ptr, 0, UInt, 20, UInt, 0x1000, UInt, 0x4)
185: SendMessage,0x418,0,0,ToolbarWindow32%idxTB%,ahk_class %sTray%
187: szBtn := VarSetCapacity(btn, (A_Is64bitOS ? 32 : 24))
188: szNfo := VarSetCapacity(nfo, (A_Is64bitOS ? 32 : 24))
189: szTip := VarSetCapacity(tip, 128 * 2)
191: Loop,%ErrorLevel%
230: DllCall("VirtualFreeEx", "Uint", hProc, "Uint", pProc, "Uint", 0, "Uint", 0x8000)
231: DllCall("CloseHandle", "Uint", hProc)
232: }
233: DetectHiddenWindows,%Setting_A_DetectHiddenWindows%
234: Return,oTrayIcon_GetInfo
083: OnExit,ExitSub
085: Loop,10
087: For index,Script in Startup
091: Sleep,A_index**2 * 1000 + 5000 (4.24)
Press [F5] to refresh.
When the script and folder are fully loaded, as I've been running it, the window gets drawn just before the icons are destroyed.