alttab.py 文件源码

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

项目:Packages 作者: Keypirinha 项目源码 文件源码
def get_window_text(hwnd):
        """
        Wrapper over the GetWindowTextW() Win32 function
        Raises a OSError exception on error.
        """
        length = ctypes.windll.user32.GetWindowTextLengthW(hwnd)
        buff = ctypes.create_unicode_buffer(length + 1)
        ctypes.windll.kernel32.SetLastError(0)
        res = ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1)
        if not res and ctypes.GetLastError() != 0:
            raise ctypes.WinError()
        return buff.value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号