views:

551

answers:

2

Hi, I'd like to know if it is possible to make a progress bar displayed on the taskbar like Windows Explorer does when there's a file operation going on? I saw many examples, but they all involved C#.

SWT won't cut it.

+1  A: 

There is no standard facility in Java for doing so, yet.

Hence you need to talk to Windows directly to do that. So you need to locate the correct Windows routine, and use JNA (probably the easiest) to invoke that routine. I do not know of a vendor or a project who has done this already.


Edit: It appears that the http://code.google.com/p/nativelibs4java/ project may do what you want.

Thorbjørn Ravn Andersen
Do you mean JNI?
configurator
No, JNA which is easier to use than JNI.
Thorbjørn Ravn Andersen
A: 

Windows exposes this through COM. I am sure a "flat DLL" call would be easier for you, but if you can get to COM you can do this. The COM interface is ITaskbarList3 (there is also an ITaskbarList4 you can use that inherits from it.) http://msdn.microsoft.com/en-us/library/dd391692(VS.85).aspx documents it. SetProgressState and SetProgressValue are the methods you will want to invoke. State is normal (green), paused (yellow), error (red), indeterminate (swooshing green) and none. On the MSDN page some community people have added details of calling this COM component from VB and C# - that might help you figure out the setup and tear down required from Java.

Kate

Kate Gregory
OK, so I have installed javax.comm, but the documentation is poor. Do you perhaps have anything to offer?
Yakov Lipkovich
Sorry but my Java days are long behind me and if I ever knew how to call a COM method from Java I have forgotten. If you need documentation on what to pass to those methods, sure, I have C# code that calls them so I know what the parameters are. Ask away.
Kate Gregory