def describe_children(self, hwnd): Logger.add(" hwnd Classname ScreenPos Label") Logger.add(" ------- ------------------------ ------------ ------------------") children = facade.get_children(hwnd) for hwnd, class_name, text in children: rect = facade.get_window_rect(hwnd) Logger.add(" %8d %-24.24s (%4d, %4d) '%s'" % (hwnd, class_name, rect[0], rect[1], text))
def describe_window(self, hwnd=None): if facade.has_win_implementation(): try: nbr_of_children = len(facade.get_children(hwnd)) if hwnd is None: hwnd = facade.get_active_window() rect = facade.get_window_rect(hwnd) Logger.bold_header("Window Description \n hwnd: %d \n Classname: '%s' \n Label: '%s'\n Nbr of children: %d\n Position: (%d, %d)\n Size: (%d, %d)" % ( hwnd, facade.get_classname(hwnd), facade.get_window_text(hwnd), nbr_of_children, rect[0], rect[1], rect[2], rect[3])) Logger.header2("Native Description") self.describe_children(hwnd) except Exception, ex: Logger.add_error("Native windows description failed")