windows.py 文件源码

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

项目:AutomatorX 作者: xiaoyaojjian 项目源码 文件源码
def attach(self, device):
        if self.device is not None:
            print "Warning: already attached to a device."
            if device is not self.device:
                self.detach()

        handle = device.hwnd
        def callback(hwnd, extra):
            extra.add(hwnd)
            return True
        self.watched_hwnds.add(handle)
        try:
            # EnumChildWindows may crash for windows have no any child.
            # refs: https://mail.python.org/pipermail/python-win32/2005-March/003042.html
            win32gui.EnumChildWindows(handle, callback, self.watched_hwnds)
        except pywintypes.error:
            pass

        self.device = device
        print "attach to device", device
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号