开发者

Adding a contribution to the windows task bar in java - similar to laptop battery widgets

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:

Adding a contribution to the windows task bar in java - similar to laptop battery widgets

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 th开发者_开发知识库is is slightly different.

Thanks in advance,

Andy


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...


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜