With functions win, wintest, child, childtest, if flag 0x8000 is used, x is interpreted as address of enumeration callback function. When searching for window, win and child functions enumerate top-level or child windows, starting from topmost. The callback function is called for each matching window. The callback function must begin with
function hwnd lParam
Here hwnd is window handle, lParam is y argument of win or child. The callback function can return 1 to continue enumeration or 0 to stop (let win or child to return hwnd). For example, it can test some additional window properties (rectangle, text inside, etc) and, if they match, return 0, else return 1.
Similarly, with function acc, the callback function must begin with
function Acc&a level lParam
Here a is the found object, level is object's level in the hierarchy (if class is specified, it is level beginning from that child window). The callback function can return 0 to stop searching, 1 to continue and search possible children, or 2 to continue and skip children.
To call the callback function for all windows or objects, all arguments except x and y should be empty ("" or 0), and flags should be 0x8000. With win, to include hidden windows, insert opt hidden 1 before.