Question

On OSX my Java application has a dock menu (using Apples extension to Java com.apple.eawt.Application.getApplication().setDockMenu) , allowing tasks to be started by right clicking on the dock icon, also files can be dropped onto the dock icon (Using Apples com.apple.eawt.OpenFilesHandler) and my application starts processing the dropped files.

I'm trying to replicate this functionality if sensible on Windows, if this behaviour on Windows is weird I don't want to do it. I cannot find a way to add tasks to to the popup menu for the application icon on the taskbar (my application is has an .exe wrapper provided by winrun4j), is that possible ?

But I have used java.awt.SystemTray to add a right click menu to that, and it works but I'm unclear in Windows when one would use the taskbar icon and when the SystemTray. What I cannot do is have the SystemTray respond to files being dropped onto it, and according to this Oracle Java issue it will never happen http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7119272. What I'm unclear about is if the Windows System tray is never meant to respond to things being dropped on it, or if this is just missing functionality in the Java implementation.

And is there way to drag files onto the taskbar icon instead, or is this whole notion of dragging files onto minimized icons purely an OSX thing and not relevent to Windows ?

Était-ce utile?

La solution

To answer my own question files cannot be dropped directly onto pinned taskbar icon or the toolbar icon, but if you drag files onto the taskbar icon it should cause the main window to be displayed and then the files can be dropped onto the window instead, and this behaviour happens automtically with no coding required on my part.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top