WindowHandlers.py 文件源码

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

项目:pytomatic 作者: N0K0 项目源码 文件源码
def hide_extra_ui(self, hwnd=None, remove=True):
        """
        :param hwnd: Hwnd to remove all styling from. If not supplied, then the default hwnd is used
        :param remove: If true: Removes all styling. If false: Adds back the removed styles
        :return: NoneType
        """

        logging.debug('Trying to manipulate UI')

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

        style = win32gui.GetWindowLong(hwnd, win32con.GWL_EXSTYLE)

        if remove:
            logging.debug('Removing UI')
            style = style | win32con.WS_POPUP
            style = style & ~win32con.WS_OVERLAPPEDWINDOW
        else:
            logging.debug('Adding UI')
            style = style & ~win32con.WS_POPUP
            style = style | win32con.WS_OVERLAPPEDWINDOW

        win32gui.ShowWindow(hwnd, win32con.SW_HIDE)
        win32gui.SetWindowLong(hwnd, win32con.GWL_STYLE, style)
        win32gui.ShowWindow(hwnd, win32con.SW_SHOW)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号