Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/07/2018 in all areas

  1. Could you try this simple script ? Seemed to be working fine with me... #include <Constants.au3> #include <GUIConstants.au3> #include <Clipboard.au3> Opt ("MustDeclareVars", 1) Global $aClip _Clipboard_GetAll($aClip) _ClipBoard_Empty() _ClipBoard_SetData ("Some text to set clipboard to",$CF_TEXT) MsgBox (0,"test","Check if clipboard is OK") _ClipBoard_PutAll($aClip) Beep () Func _Clipboard_GetAll(ByRef $avClip) Local $iFormat = 0, $iNum If Not _ClipBoard_Open(0) Then Return SetError(-1, 0, 0) $iNum = _ClipBoard_CountFormats () Dim $avClip[$iNum+1][2] $avClip[0][0] = $iNum For $i = 1 to $iNum $iFormat = _ClipBoard_EnumFormats($iFormat) $avClip[$i][0] = $iFormat Next _ClipBoard_Close() For $i = 1 to $iNum $avClip[$i][1] = _ClipBoard_GetData ($avClip[$i][0]) Next EndFunc Func _ClipBoard_PutAll(ByRef $avClip) Local $bEmpty, $iErr = 0 If Not _ClipBoard_Open(0) Then Return SetError(-2, 0, 0) $bEmpty = _ClipBoard_Empty() _ClipBoard_Close() if not $bEmpty then Return SetError(-3, 0, 0) For $i = 1 To $avClip[0][0] If _ClipBoard_SetData ($avClip[$i][1], $avClip[$i][0]) = 0 Then $iErr += 1 Next If $iErr Then Return SetError(-4, $iErr, 0) Else Return 1 EndIf EndFunc
    2 points
  2. caramen

    Encrypting INI Data

    Hello. Here you go: #include <Crypt.au3> Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data. Local $sData = "..upon a time there was a language without any standardized cryptographic functions. That language is no more." ; Data that will be encrypted. Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_RC4) ; Encrypt the data using the generic password string. MsgBox(0, "Crypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted)) MsgBox(0, "Crypted data", "Nothing"&@CRLF&$bEncrypted) MsgBox(0, "Crypted data", "StringToBinary"&@CRLF&StringToBinary($bEncrypted)) $bEncrypted = _Crypt_DecryptData($bEncrypted, $sUserKey, $CALG_RC4) ; Decrypt the data using the generic password string. The return value is a binary string. MsgBox(0, "Decrypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted)) ; Convert the binary string using BinaryToString to display the initial data we encrypted. MsgBox(0, "Decrypted data", "Nothing"&@CRLF&$bEncrypted) MsgBox(0, "Decrypted data", "StringToBinary"&@CRLF&StringToBinary($bEncrypted)) Cya
    1 point
×
×
  • Create New...