Windows TrayIcon's
Return to home page
Comments Loading...
2005-01-09

I've been looking in to putting my windows in to the Tray Icon in Smalltalk. This turned out to be more than I expected it to be. Luckily, some people had already done most of the hard work and published it in to a fork of Windows Goodies.

I knew that the code would never be adopted if it stayed there. So I pain-stakingly moved it out of there in to its own package. Once there, I wanted to add in right click menus on the toolbar.

After a lot of experimentation, I managed to coerse th VM in to passing unknown events back in to the system by providing windows with the right kind of UI handle.

But because it's an unknown event, none of the VM's code for handling mouse clicks has been executed - so we're left with a big bundle of random bytes from the OS. So after analysing it for a while in the Transcript (making it print out the data as the event occurs) I discovered the right combination of checks to handle various mouse events.

Hooking up a popup menu was easy from there. The only thing that remained was separating the code from its dependency on the VisualLauncher.

While the code isn't fantastic and I make no guarantee about how useable it is or whether it is rock solid or not - it's there now. Amazingly, the day I published it to public store both Bob Westergaard and James Robertson picked it up. Bob now uses it in "Paste It Everywhere" and Jim is intending to use it in Bottom Feeder to replace his slim mode.