WindowHandlers.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:pytomatic 作者: N0K0 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号