Code Red > AutoLISP (Vanilla / Visual)

Clear Windows Clipboard?

(1/2) > >>

mkweaver:
I need to be able to clear previously pasted drawing objects from the windows clipboard to avoid inadvertantly pasting bad info into a drawing.  I have created the following code, but it doesn't seem to work.

Suggestions appreciated.

Mike Weaver


--- Code: ---;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;  Routine: ClearClipBoard ;;;
;;;  Purpose: Clears all data from the windows clipboard ;;;
;;;  Arguments: none ;;;
;;;  Returns: nothing of value ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ClearClipBoard ( / objIEA doc body)
  (vl-load-com)
  (setq objIEA (vlax-create-object "InternetExplorer.Application"))
  (vlax-put-property objIEA "Visible" :vlax-false)
  (vlax-invoke objIEA "Navigate2" "about:blank")
  (while (/= 4 (vlax-get-property objIEA "ReadyState"))
    (princ ".")
    )
  (setq doc  (vlax-get-property objIEA "Document")
body (vlax-get-property doc "Body")
Window (vlax-get-property doc "ParentWindow")
ClipBoard (vlax-get-property window "ClipBoardData")
)
 
  (vlax-invoke-method ClipBoard "ClearData" )
  (vlax-release-object ClipBoard)
  (vlax-release-object Window)
  (vlax-release-object body)
  (vlax-release-object doc)
  (vlax-release-object objIEA)
  (gc)
  (princ)
  )
--- End code ---

It's Alive!:
Would something like using Doslib’s dos_clipboard with a space work?
i.e.

--- Code: ---(dos_clipboard " ")

--- End code ---

GDF:
;;; http://www.geometricad.com
;;; by Luis Esquivel
;;; ClipBoard Functions:
;;; Usage: (SetClipboardText <String>)
;;; Usage: (GetClipboardText)
;;; Usage: (EmptyClipboard)

Maybe Luis can help?

It's Alive!:
I also have some arx code here http://www.theswamp.org/index.php?topic=17605.0.
let me know if you need one rolled up

JohnK:
Here is a small app for you.


--- Code: ---Sub Main()
   Clipboard.Clear
End Sub
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version