views:

64

answers:

4

Hey guys,

I am trying to make a contribution to the windows task bar so when i minimize my app it docks itself into the windows task bar , the best way of describing this is by looking at a picture I have drawn:

alt text

If anybody knows if this is possible or how to do it please let me know.

I am well aware of the ability to add an icon to the system tray - but this is slightly different.

Thanks in advance,

Andy

+1  A: 

You should probably have to use JNI or JNA to achieve this - wrapping the native windows API seems like the most viable idea. It'll greatly diminish the value of using Java, however - using JNI/JNA should always be considered last resort...

Bozhidar Batsov
Have you got an idea or an example of how to do this?
RenegadeAndy
You simply need to find the appropriate native windows library for you r task and wrap it in Java with JNI/JNA. I'm not a windows user myself, you I have no idea where you should start...
Bozhidar Batsov
A: 

You just need to use the System Tray functionality available in Java 6.

If you look at the More Information section at the bottom of that page it has links to the System Tray API and an example project.

Devon_C_Miller
RegenadyAndy mentions in his question, that he's aware of the that capability, but it doesn't suit him. Frankly Java's system tray functionality is a piece of cr*p. I've had a lot of dealings with it and simply hate it - let's hope Java 7 will offer some improvements in the area...
Bozhidar Batsov
He was asking something different
Xorty
A: 

Take a look at SWT. This will definitely be a platform specific solution but I am assuming this isn't an issue for you.

SWT (Beginning with 3.6 which just went gold) has a TaskBar class and corresponding TaskItem classes for each item in the TaskBar. I don't think the TaskItem class is going to be powerful enough to do what you are asking for, but by looking at the source it will provide you insight into the low level Windows calls that you can access to get this done.

The SWT version for Windows will have a low level platform specific API that should get you where you want to go. Basically they have done all the JNA/JNI work for you. I am not a Windows programmer so I can't give you more details, but hopefully this will point you in the right direction.

rancidfishbreath
A: 

Could you hide your application on minimize and then add an icon for it to the system tray that, when clicked, unhides your application?

davetron5000