def create_boundingbox(self, hwnd = None, windows_style=False):
"""
Creates a bounding box of the window.
Args:
hwnd (int): the window handle we are going to find. If not supplied
the hwnd from the last get_hwnd_by_title will be used
Returns:
Creates a tuple with four elements. The upper left coordinates
and the lower right coordinates. (left, top, right,buttom window borders)
"""
if hwnd is None:
hwnd = self.get_hwnd()
logging.debug('Trying to find the box for 0x{:2X}'.format(hwnd))
self.bbox = win32gui.GetWindowRect(hwnd)
logging.debug('Found {}'.format(self.bbox))
if windows_style:
pos_size = self.get_bbox_size(self.get_bbox())
return ()
else:
return self.bbox
评论列表
文章目录