zoukankan      html  css  js  c++  java
  • 关于剪切板操作的三个函数

    (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))

  • 相关阅读:
    Random 种子问题
    Matrix issue
    Two sum.
    Best Time to Buy and Sell Stock
    Maximum difference between two elements
    二分查找法的实现和应用汇总
    Why you want to be restrictive with shrink of database files [From karaszi]
    Palindrome
    NetBeans vs Eclipse 之性能参数对比 [java060515]
    国内各大互联网公司相关技术站点不完全收录[转]
  • 原文地址:https://www.cnblogs.com/mjgw/p/12459495.html
Copyright © 2011-2022 走看看