|
以前 xdapi 第一次实现了CAD 中读写剪贴板,现在 Vlisp 也可以做到了:)
;;读剪贴板文字
(defun xdl-getcliptext (/ ieobj str)
(setq
ieobj (vlax-get-or-create-object "Internetexplorer.application")
)
(vlax-invoke ieobj 'navigate "about:blank")
(setq str
(vlax-invoke
(vlax-get (vlax-get (vlax-get ieobj 'document) 'parentwindow)
'clipboarddata
)
'getdata
"text"
)
)
(vlax-release-object ieobj)
str
)
;;往剪贴板写文字
(defun xdl-setcliptext (str / ieobj)
(setq
ieobj (vlax-get-or-create-object "Internetexplorer.application")
)
(vlax-invoke ieobj 'navigate "about:blank")
(vlax-invoke
(vlax-get (vlax-get (vlax-get ieobj 'document) 'parentwindow)
'clipboarddata
)
'setdata
"text"
str
)
(vlax-release-object ieobj)
)
|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )
GMT+8, 2024-5-11 03:40 , Processed in 0.244289 second(s), 23 queries , Gzip On.
Powered by Discuz! X3.5
© 2001-2024 Discuz! Team.