Forum Discussion

yaacovk's avatar
yaacovk
Contributor
9 years ago
Solved

Find method- Is it possible to define property to be different than a specific value

Hi,   I want to use the FindChild method but 1 of required properties is not known. I only know that this property have to be greater than a specfic value. For example, I want to use a script lik...
  • mes6073's avatar
    9 years ago

    Since you can't really define that type of property, seems like you would be better served defining the WndClass and Visible properties and using the FindAllChildren, then iterate the collection that is returned evaluating for the control with the ScreenLeft property value meets the required criteria:

    var x = <value>;
    var wndClass = "WindowClassName";
    var props = new Array("WndClass", "Visible");
    var values = new Array(wndClass, True);
    var ctrls = wnd.FindAllChildren(props, values, 15);
    
    for (var i = 0; i < ctrls.length; i++)
    	if ()ctrls[i].ScreenLeft > x) {
    		Log.Message("FullName: " + ctrls[i].FullName + "\r\n" +
    						"ScreenLeft: " + ctrls[i].ScreenLeft);	
    	}
    }