关于剪切板操作的三个函数
作者:互联网
(defun ClearClipBoard ()
(startapp "cmd /c \"echo off | clip\"")
) ; (clearclipboard)
(defun _SetClipBoardText (text / htmlfile result)
;; Caller's sole responsibility is to pass a
;; text string. Anything else? Pie in face.
;; Attribution: Reformatted version of
;; post by XShrimp at theswamp.org.
;;
;; See <a href=\"http://tinyurl.com/2ngf4r.\" target=\"_blank\">http://tinyurl.com/2ngf4r.</a>
(setq result
(vlax-invoke
(vlax-get
(vlax-get
(setq htmlfile (vlax-create-object "htmlfile"))
'ParentWindow
)
'ClipBoardData
)
'SetData
"Text"
text
)
)
(vlax-release-object htmlfile)
text
) ;( _SetClipBoardText "testing")
(defun _GetClipBoardText (/ htmlfile result)
;; Attribution: Reformatted version of
;; post by Patrick_35 at theswamp.org.
;;
;; See <a href=\"http://tinyurl.com/2ngf4r.\" target=\"_blank\">http://tinyurl.com/2ngf4r.</a>
(setq result
(vlax-invoke
(vlax-get
(vlax-get
(setq htmlfile (vlax-create-object "htmlfile"))
'ParentWindow
)
'ClipBoardData
)
'GetData
"Text"
)
)
(vlax-release-object htmlfile)
result
) ;(setq test (_GetClipBoardText))
标签:函数,get,htmlfile,text,setq,剪切板,操作,vlax,result 来源: https://www.cnblogs.com/mjgw/p/12459495.html