Forum Discussion

murugans1011's avatar
murugans1011
Regular Contributor
11 years ago
Solved

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
    11 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