Very cool. I haven't ever made a systray app in VB6, but if ever there was one that called out for it this is it. You read my mind.
I modelled the indicator from the original thread to mimic how ZoneAlarm looks in the tray when uploading/downloading. It uses a single icon to model both, with the red showing upload activity and the green showing download. Part of the reason I picked blue was to keep it different from both ZoneAlarm colors. I modelled it exactly, with 5 sections of two-pixel high sections surrounded by black edges.
Attached is a screenshot of how ZoneAlarm looks in action. I'm thinking I'd like to do the same kind of thing with atwo bars for read/writes to the hard drive and actually use it for real. I'll put the graduated bar back in just because I really like it. I figure I can have it done by the weekend if not this afternoon.
Any suggestion for the colors for the read and write sections? Ideally different from ZoneAlarm, so no red or green. My physical hard drive indicator light is blue, which is why I went with that originally. Not sure what would work best with blue.
EDIT: I just noticed that when you draw the indicator, you first draw a box and then issue four line commands to draw the border. You can do the border with a single B command without the F. (B=Box, F=Filled)
Last edited by Ellis Dee; Dec 10th, 2009 at 02:11 PM.
Very cool. I haven't ever made a systray app in VB6, but if ever there was one that called out for it this is it. You read my mind.
OK thanks, I don't know the Line command very well & it always gives me headaches, this seems to do the trick,
' draw black lines around edges
pic.Line (0, 31)-(31, 0), 0, B
Ya I was thinking the same thing, split it and have one side for the reads and other for writes, I have an app similar to this one for the LAN read/writes, but in that I use a couple images and blit them to create the bitmap for the icon.
Hmmmm maybe a Blueish color for reads and Orangey color for writes?
Attached is a new version with dual read/write indicators. I don't hate the colors, but I'm not in love with them either so feel free to tinker with them and post back if you come up with better ones.
I intentionally made the lowest rung indicator light up if the activity returned is any nonzero number. Now that I'm running it, this may be too sensitive. It appears my hard drive maintains a low-level background hum of disk writes, I'm guessing something like 0.02% activity or something miniscule like that. It may be better to ignore all activity below 1.
Would it be possible to have the tray icon revert to the actual form icon (disk.ico) after, say, 2 full seconds of complete inactivity?
EDIT: Attachment moved to next post.
Last edited by Ellis Dee; Dec 15th, 2009 at 10:28 PM.
Here's a shiny new version. I've moved all the systray code into a single class. I pulled as much of the code out of the systray form as was possible because the programmer will have to add code to it to handle events. The systray class, OTOH, is a black box that never needs to be opened.
I added functionality to revert back to the app icon after two seconds of inactivity. I also corrected the bug that wasn't closing the tray icon when the app closes. Finally, I added basic balloon tip functionality.
I created a generic system tray codebank thread here.
Last edited by Ellis Dee; Dec 15th, 2009 at 10:49 PM.