如何检查Flex AIR应用程序是否最小化到系统托盘?
我有一个 AIR 应用程序,在其中监视服务器。默认情况下,它将最小化到系统托盘。每当服务器发送警报时,系统中最小化的应用程序应该显示一条类似于 Outlook 的消息(警报类似于新消息到来时)。
我的问题是,如何检查 AIR 应用程序是否最小化到系统托盘。我尝试了以下条件
if( this.stage.nativeWindow.displayState == NativeWindowDisplayState.MINIMIZED)
{
//Write code here
}
,但此代码不起作用。条件始终为假。当我调试并尝试查看显示状态的值时,它始终处于最大化状态。
我不确定我哪里做错了。
任何人都可以帮我找出检查应用程序是否最小化到系统托盘的条件。
I have an AIR Application in which i am monitoring a server. By Default, it will be minimized to system tray. Whenever server sends an alert, then minimized application in system should display a message similar to outlook(Alerts similar to, when a new message comes).
My problem is, How to check whether an AIR application is minimized to system tray or not.i have tried the following condition
if( this.stage.nativeWindow.displayState == NativeWindowDisplayState.MINIMIZED)
{
//Write code here
}
But this code didn't work. The condition is always false. When i have debugged and tried to see the values of the displaystate, it is always having maximized state.
I am not sure, where i am doing wrong.
Can anybody, please help me to find out the condition for checking whether the application is minimized to system tray or not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的窗口不可见,并不一定意味着它已最小化。
如果窗口是轻量级窗口,您可以通过轮询 NativeWindow 的可见属性。
更多信息:Adobe AIR - 管理 Windows
if your window is not visible it doesn't necessarily mean it is minimized.
if the window is a lightweight window, you could simply manage it's visiblility by polling for the NativeWindow's visible property.
more: Adobe AIR - Managing Windows