How to check whether Flex AIR application is minimized to system tray or not?

1.3k views Asked by At

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.

1

There are 1 answers

0
Chunky Chunk On

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