While developing an AIR application, I had an issue with bringing the application to front (above all other windows) when clicking the systemTrayIcon.
Usually, you would use the method:
1.
systemTrayIcon.addEventListener( "click" , function () {
2.
window.nativeWindow.orderToFront();
3.
});
But doing so will result in… actually nothing at all. The window doesn’t move.
Using the same code on a menu item of the SystemTrayIcon will work, but not on the click action of the Icon itself.
Workaround:
Set the window property alwaysInFront to true and then to false:
1.
systemTrayIcon.addEventListener( "click" , function () {
2.
window.nativeWindow.alwaysInFront = true ;
3.
window.nativeWindow.alwaysInFront = false ;
4.
});
Not the way it should be, but it works…
本文介绍了一种在Adobe AIR应用程序中使窗口前置的有效方法。当点击系统托盘图标时,通常的方法无法使窗口前置到其他所有窗口之上。本文提供了一个解决此问题的方案:通过暂时设置窗口为始终在前,然后取消该设置。
1万+

被折叠的 条评论
为什么被折叠?



