*Format Item item 1 list "Tray" iconfile "C:\WINDOWS\system32
\shell32.dll" iconnum &(volume)
OR
cl.seticon("tray",1,"C:/WINDOWS/system32/shell32.dll",volume)
will set the volume to the nth icon in the file, where n = 0-255
depending on the volume.
I am not sure why you included for and endfor stuff. It won't help,
as far as I can see.
You may find the levels.icl or digits.icl files found here useful,
although you will have to divide the volume variable by some number
to get an index compatible with these files (e.g. between 0 and 14
for levels).
http://tech.groups.yahoo.com/group/power-
pro/files/Icons_and_cursors/Bruce%20Switzer/
This solution is not complete since it only sets the volume once and
does not change the icon if the volume changes. To do that, you can
- only use PowerPro to change the volume and run the command from a
script that changes the volume
- or, run a timer that resets the icon (say) once a second using a
script. To avoid flicker and extra screen i/o, this script should
store the last volume it sees in a static variable and only change
the icon if the volume changes
static lastvolume
static doneinit
if (volume !=lastvolume||!doneinit) do
doneinit=1
lastvolume=volume
cl.seticon(.. as above..)
endif