How to get flashing on OS task bar work? [message #466712] |
Sun, 15 January 2006 20:46  |
Eclipse User |
|
|
|
Originally posted by: rain_zzj.zdus.com
Hi, every one
I got a trouble to make my app flash on OS task bar:
My app is keeping receiving messages from JMS server; for every message it
received, I'd like it flash on the OS task bar when the app window is
minimized or unactive, just like the behaviour MSN does when I receive a
message.
I use the following statement to get it work:
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.window.getShell().forceActive();
Everything goes fine when the app is running on Win2000.
But on Winxp, the app acts totally differently, the backend RCP
application will always popup to interrupt the user's current activity on
other application.
Any one has some idea on it?
Another question followed-up: It seems the statement does not work at all:
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.window.getShell().setActive();
So what's the difference between them?
It may be a bussiness of RCP, but I was told that I could probably find
help here.
Thanks in advance,
Jason
|
|
|
|
Re: How to get flashing on OS task bar work? [message #466817 is a reply to message #466779] |
Tue, 17 January 2006 16:46   |
Eclipse User |
|
|
|
Flashing in windows is based on the application requiring a message to be delivered. This is done in a very specific way through WFC which is not mirrored through SWT. The best way to simulate the behavior is Shell#forceActive() As has been pointed out, this does have the unfortunate consequence of putting the window on top of the others occaisionally. Also, if the window is the *only* window open and is then minimized, windows won't even flash the toolbar on forceActive(), it will simply ignore the call.
As was pointed out, it is possible to force a flash by using MessageBox, but then this pulls up an unsightly and undesired message box which must be closed by the user. In other words, there really isn't a good way to do this in either Swing or SWT. If you really, really need this functionality and are willing to tie yourself to win32, build your own method which calls the native methods to force the flash. The window control handle is in Shell#handle.
|
|
|
|
|
|
|
|
Re: How to get flashing on OS task bar work? [message #466960 is a reply to message #466948] |
Thu, 19 January 2006 22:06  |
Eclipse User |
|
|
|
It's not a problem talking to Cocoa; you can do that on Mac OS X anyway. The problem is that Cocoa and Carbon applications are completely different. (Think the difference between a Gnome app and a KDE app -- or on windows, the difference between Firefox and Internet Explorer.) They both achieve roughly the same goal, but do it in completely different ways.
So knowing how to flash a Cocoa app's icon isn't going to help Eclipse, which is a Carbon-based life form. The notification manager Carbon API might help this.
Alex.
|
|
|
Powered by
FUDForum. Page generated in 0.26810 seconds