System tray code that works?

BlitzMax Forums/BlitzMax Programming/System tray code that works?

JoshK(Posted 2010) [#1]
Does anyone have working code that creates a system tray icon with a popup menu?


xlsior(Posted 2010) [#2]
There's two of them:

IIRC gman(?) has some system tray code that works, but requires a DLL. It may be linked somewhere in the code archives.

Personally I've used Fabian's fmc.mod whihc has system tray code that works without needing any extra dll's. Unfortunately the fmc.mod in its entirety broke 2-3 years ago due to changes in blitzmax, but I have a stripped down version that still includes the system tray functionality, which does work with the latest blitzmax.
Let me know if you want a copy...


JoshK(Posted 2010) [#3]
Yes, please. Does it handle a popup menu on the tray? Thanks.

jklint at leadwerks dotcom

Last edited 2010


Hezkore(Posted 2010) [#4]
I've been looking for something like this myself, you should post it in the Codes Archives or something xlsior.
(Could you Mail me it too, Hezkore (at) GMail (dot) com)


Volker(Posted 2010) [#5]
I'm using the last example from here. Works fine.
http://www.blitzbasic.com/codearcs/codearcs.php?code=1643

Click the red cross to close the window.
there will be an invisible
icon in the tray, because the icon file is missing.
IIRC the path to the icon must be set in:
RegisterTrayIcon(panSysTray, AppTitle, "icon.ico")


xlsior(Posted 2010) [#6]
Yes, please. Does it handle a popup menu on the tray? Thanks.


I uploaded a copy here:
http://www.xlsior.org/temp/fmc.mod.zip

The fmc.mod used to be a more elaborate framework that did a bunch of gui and threading stuff, but bits and pieces broke when the author stopped updating it, and blitzmax kept changing things.

I made some tweaks to keep it working when the MaxGUI module was overhauled, and removed a bunch of the broken (sub)modules from the package, but the tray portion is appears fully functional with the latest Blitzmax and Maxgui versions.

As far as functionality is concerned:

It can do both a pop-up menu (right-click) or detect a left-click on the tray icon. It also does sub-menus and can checkmarks in front of menu items.

There is an example of the systray stuff in the systray/doc folder, but it's a very basic: the example doesn't actually set a tray icon, but merely adds a blank space to the systemtray you can launch.

You can easily load your own .ico files to use, though:

Icon1:TSystemIcon = TSystemIcon.FromFile ( "icon1.ico" ) 'loads the first icon 


Changing icons on the fly is possible too, I've used it in the past to show an animated icon while the program was receiving data that way.


Hezkore(Posted 2010) [#7]
Hmm can't seem to get the FMC mod to work in threaded mode. :/

BlitzMax/mod/fmc.mod/objecttool.mod/objecttool.release.mt.win32.x86.a(objecttool.bmx.release.mt.win32.x86.o): undefined reference to `bbGCFree'


JoshK(Posted 2010) [#8]
Wow, now that is pretty fancy. Works great!


xlsior(Posted 2010) [#9]
Wow, now that is pretty fancy. Works great!


Yeah, it never got much attention when it was posted here back in the day, but I've found it very useful myself as well.


JoshK(Posted 2010) [#10]
You know what would be awesome is if you could do those little popup bubble notifications. I have a very good use for it, if anyone can figure it out.


xlsior(Posted 2010) [#11]
What do you mean? Mouse-over popup notice, or just automated status updates?


JoshK(Posted 2010) [#12]
The automatic popup that occurs with some programs when something important happens, with that little "pop" sound. I could do that when files get automatically converted, or when a new news item is posted.

Last edited 2010