WindowHandlers.py 文件源码

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

项目:pytomatic 作者: N0K0 项目源码 文件源码
def init_window(self, hwnd=None, pos=None, borderless=False, config = None):
        """
        At the moment only sets the window in the foreground and moves it to a posistion set in the config.

        Args:
            hwnd (int): the window handle to "initialize". If not supplied
                the hwnd from the last get_hwnd_by_title will be used
            pos (tuple): a tuple describing the X,Y,Height and Width of the window
            borderless (Bool): Removes extra styling like borders if true. Can be reapplied with:
                hide_extra_ui(hwnd,remove=False)
        Returns:
            If the window was brought to the foreground, the return value is
                nonzero. If the window was not brought to the foreground, the
                return value is zero.
        """

        if hwnd is None:
            hwnd = self.get_hwnd()

        logging.debug("Init window 0x{:2x}".format(hwnd))

        if borderless:
            self.hide_extra_ui()

        if pos is not None:
            self.move(pos, hwnd)
        return win32gui.SetForegroundWindow(hwnd)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号