ozmike Posted November 17, 2012 Share Posted November 17, 2012 (edited) Hiclipput and clipget will get & put text from clipboard.I want to get everything on clipboard (not just text) store it in a variableand then at some later time restore it?In autoit how do you copy the whole clipboard contents (not just text) and restore it ?I noticed in autohotkey they have a ClipboardAll function -ClipboardAll contains everything on the clipboard (such as pictures and formatting). It is most commonly used to save the clipboard's contents so that the script can temporarily use the clipboard for an operation. When the operation is completed, the script restores the original clipboard contents as shown below:whats autoit equivalent?This is my attempt can't get it to work i'm really stumped..any ideas - does anyone know how to do this?ah ha - this might be the bones i', looking for...tell us if you have any other ideas...expandcollapse popup#include #include #include #include Opt('MustDeclareVars', 1) Global $iMemo _Main() Func _Main() Local $hGUI, $iFormat, $iCount ; Create GUI $hGUI = GUICreate("Clipboard", 600, 400) $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() ; Open the clipboard If Not _ClipBoard_Open ($hGUI) Then _WinAPI_ShowError ("_ClipBoard_Open failed") ; Show clipboard formats available MemoWrite("Clipboard formats ..: " & _ClipBoard_CountFormats ()) ; Enumerate clipboard formats before Do $iFormat = _ClipBoard_EnumFormats ($iFormat) If $iFormat <> 0 Then $iCount += 1 MemoWrite("Clipboard format " & $iCount & " .: " & _ClipBoard_FormatStr ($iFormat) & " " & $iFormat) EndIf Until $iFormat = 0 local $v,$f ; backup clipboard $v = _ClipBoard_GetData () $f = _ClipBoard_EnumFormats (0) ConsoleWrite("Clipboard formats before..: " & _ClipBoard_CountFormats()& @CRLF) ; clear clipboard clipput("") ; restore clipboard _ClipBoard_SetData ($v , $f) ; Close the clipboard _ClipBoard_Close () If Not _ClipBoard_Open ($hGUI) Then _WinAPI_ShowError ("_ClipBoard_Open failed") ConsoleWrite("Clipboard formats after restore..: " & _ClipBoard_CountFormats()& @CRLF) ;$v = _ClipBoard_GetData () ConsoleWrite("Clipboard formats ..: " & _ClipBoard_CountFormats()& @CRLF) sleep(1000); MemoWrite("====== " ) ; Show clipboard formats available MemoWrite("Clipboard formats ..: " & _ClipBoard_CountFormats ()) ; Enumerate clipboard formats after Do $iFormat = _ClipBoard_EnumFormats ($iFormat) If $iFormat <> 0 Then $iCount += 1 MemoWrite("Clipboard format " & $iCount & " .: " & _ClipBoard_FormatStr ($iFormat) & " " & $iFormat) EndIf Until $iFormat = 0 ; Close the clipboard _ClipBoard_Close () ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main ; Write message to memo Func MemoWrite($sMessage = "") GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite ;_ClipBoard_SetData ("ClipBoard Library") ;local $v = _ClipBoard_GetData () ;_ClipBoard_SetData ($v) Edited November 17, 2012 by ozmike Link to comment Share on other sites More sharing options...
water Posted November 17, 2012 Share Posted November 17, 2012 (edited) Did you have a look at the ClipBoard UDF that comes with AutoIt? Edited November 17, 2012 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
ozmike Posted November 17, 2012 Author Share Posted November 17, 2012 (edited) thanks i have looked at this udf - for last couple of weekscopying non text from clipboard is non trival - !just found this might help - the bones of another - auto it explorer... Edited November 17, 2012 by ozmike Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now