testClipboard.py 文件源码

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

项目:pupy 作者: ru-faraon 项目源码 文件源码
def GetData(self, fe):
        ret_stg = None
        cf, target, aspect, index, tymed  = fe
        if aspect & pythoncom.DVASPECT_CONTENT and \
           tymed==pythoncom.TYMED_HGLOBAL:
            if cf == win32con.CF_TEXT:
                ret_stg = pythoncom.STGMEDIUM()
                # ensure always 'bytes' by encoding string.
                ret_stg.set(pythoncom.TYMED_HGLOBAL, str2bytes(self.strval))
            elif cf == win32con.CF_UNICODETEXT:
                ret_stg = pythoncom.STGMEDIUM()
                ret_stg.set(pythoncom.TYMED_HGLOBAL, unicode(self.strval))

        if ret_stg is None:
            raise COMException(hresult=winerror.E_NOTIMPL)
        return ret_stg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号