views:

1003

answers:

3

Hello everyone,

This is my first post on Stack Overflow and I'm just wondering on the options of making a system tray application. The application would run primary from the system tray while still operating, and could be brought up into a window when clicked on. It is also needed to have some support for global keystroke tracking, to bring up a window.

I'm curious on what options I have available to me, as I'm sure that there are many ways to do this. I'm most familiar with with Java though I have some experience with C++. I'm willing to explore other languages if they have some definite perks to them, though it would be nice to work with what I know in a way.

Thank you

+1  A: 

Plain old Winforms would get my vote.

If you are familiar with Java you should have little difficulty using one of the managed languages to create a simple tray app with .NET.

Here is some advice on the correct way to create a tray app.

Dan
+6  A: 
coobird
Thank you for the suggestion, I'll give java a try. Though I might also try the suggestion of using WTL that Foredecker suggested. I would assume that the C++ WTL route would be better performance wise, though I wonder by how much (if it is really noticeable, though I guess it actually depends on the application itself in a sense).Thank you for your input on the matter.
Blitz Bolt
+2  A: 

Be carefully with manged applications and Java here. Tray applications run all the time. So, if they are poorly written then they can use enough system resources to interfere with other things.

There is nothing wrong with manged code or Java in general, but it can be more difficult to keep managed or java apps frugal with memory, I/O and CPU time.

I'm saying this as a dev manger on the Windows perf team - we've seen lots and lots of very piggy tray applications. Yes, some are even windows or MSFT applications.

It may be a better approach to write a very small light weight tray app that launches a richer process when the user needs it. You can write your try app in simple C++ right on top of the low level Win32 APIs. If you don't want to use the Win32 APIs directly, you can use the Windows Template Library.

Foredecker
It is undoubtedly easy to get caught out with a long running app with regard to memory.But by your rationale, it would also be safe (and arguably quicker than using win32) to write a thin UI layer as a tray app in a managed language :)
Dan
That's not true. Especially with memory, it is harder to be frugal with manged languages and Java than it is with Native apps. I've seen many examples of this. For example, the little clock in Coobird's example is most likely much larger than it would be if it were written in native code. This is especially true since it is always active. Note! i'm not saying that managed or java apps are the wrong choice here - only that extra care is need to keep them from using too many resources.
Foredecker