Forum Discussion

murugans1011's avatar
murugans1011
Regular Contributor
12 years ago

Toplevel window

how to check whether the window is top-level window using if condition..i have an apps which i will work with multiple window i want to find whether the window is top level window in desktop or not in...
  • karkadil's avatar
    12 years ago
    You can use ActiveWindow method




    function isWindowTop(wnd)


    {


      var topWin = Sys.Desktop.ActiveWindow();


      return wnd.id == topWin.id;


    }



    Usage example:


    var wCalc = Sys.Process("CalcPlus").Window("SciCalc");


    Log.Message(isWindowTop(wCalc));



    Prints True if Calculator is top-level, False otherwise