Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/30/2022 in all areas

  1. Danyfirex

    Gzip to text

    You need to do it like this: #include <Array.au3> Global $Zlib_Dll = Null __ExampleB() ; #FUNCTION# ============================================================================= ; Name...........: __ExampleB( Gzip string ) ; ======================================================================================== Func __ExampleB() ConsoleWrite('> __ExampleA( Gzip string: Welcome to Autoit )' & @CRLF) Global Const $Z_OK = 0 Global Const $Z_STREAM_END = 1 Local Const $Z_MAX_WBITS = 15 Local Const $tagz_stream_s = _ "ptr next_in;" & _ ; /* next input byte */ "uInt avail_in;" & _ ; /* number of bytes available at next_in */ "uLong total_in;" & _ ; /* total nb of input bytes read so far */ "ptr next_out;" & _ ; /* next output byte should be put there */ "uInt avail_out;" & _ ; /* remaining free space at next_out */ "uLong total_out;" & _ ; /* total nb of bytes output so far */ "ptr msg;" & _ ; /* last error message, NULL if no error */ "ptr state;" & _ ; "ptr zalloc;" & _ ; /* used to allocate the internal state */ "ptr zfree;" & _ ; /* used to free the internal state */ "ptr opaque;" & _ ; /* private data object passed to zalloc and zfree */ "int data_type;" & _ ; /* best guess about the data type: binary or text */ "uLong adler;" & _ ; /* adler32 value of the uncompressed data */ "uLong reserved;" ; /* reserved for future use */ Local Const $tagz_gz_header_s = _ "int text;" & _ ; /* true if compressed data believed to be text */ "uLong time;" & _ ; /* modification time */ "int xflags;" & _ ; /* extra flags (not used when writing a gzip file) */ "int os;" & _ ; /* operating system */ "ptr extra;" & _ ; /* pointer to extra field or Z_NULL if none */ "uInt extra_len;" & _ ; /* extra field length (valid if extra != Z_NULL) */ "uInt extra_max;" & _ ; /* space at extra (only when reading header) */ "ptr name;" & _ ; /* pointer to zero-terminated file name or Z_NULL */ "uInt name_max;" & _ ; /* space at name (only when reading header) */ "ptr comment;" & _ ; /* pointer to zero-terminated comment or Z_NULL */ "uInt comm_max;" & _ ; /* space at comment (only when reading header) */ "int hcrc; " & _ ; /* true if there was or will be a header crc */ "int done;" ; /* true when done reading gzip header (not used when writing a gzip file) */ Local $binString = '0x1F8B080000000000000B0B4FCD49CECF4D5528C957702C2DC9CF2C0100054D2B3C11000000' ;~ Welcome to Autoit Local $o_ZlibFPath = @ScriptDir & '\zlib1.dll' Local $Zlib_Dll = DllOpen($o_ZlibFPath) Local $sVersion = DllCall($Zlib_Dll, "str:cdecl", "zlibVersion")[0] Local $iRequiredSize = 0 For $iFlag = 1 To 2 Local $tStream = DllStructCreate($tagz_stream_s) Local $iSizeStream = DllStructGetSize($tStream) Local $iSizeBinBuffer = BinaryLen($binString) Local $tInBuffer = DllStructCreate("byte[" & $iSizeBinBuffer & "]") DllStructSetData($tInBuffer, 1, $binString) $tStream.next_in = DllStructGetPtr($tInBuffer) $tStream.avail_in = $iSizeBinBuffer Local $aCall = DllCall($Zlib_Dll, "int:cdecl", "inflateInit2_", "ptr", DllStructGetPtr($tStream), "int", $Z_MAX_WBITS + 32, "str", $sVersion, "int", $iSizeStream) Local $tHeader = DllStructCreate($tagz_gz_header_s) Local $aCall = DllCall($Zlib_Dll, "int:cdecl", "inflateGetHeader", "ptr", DllStructGetPtr($tStream), "ptr", DllStructGetPtr($tHeader)) If $iFlag = 1 Then Local $tTempBuffer = DllStructCreate("char[1024]") Local $ilenTempBuffer = DllStructGetSize($tTempBuffer) Else Local $ilenTempBuffer = $iRequiredSize Local $tTempBuffer = DllStructCreate("char[" & $ilenTempBuffer & "]") EndIf Local $iRet = 0 While True $tStream.next_out = DllStructGetPtr($tTempBuffer) $tStream.avail_out = $ilenTempBuffer $iRet = DllCall($Zlib_Dll, "int:cdecl", "inflate", "ptr", DllStructGetPtr($tStream), "int", 0)[0] If Not (($tStream.avail_out = 0) And (($iRet <> $Z_STREAM_END))) Then ExitLoop EndIf WEnd If $iFlag = 1 Then $iRequiredSize = $tStream.total_out EndIf DllCall($Zlib_Dll, "int:cdecl", "inflateEnd", "ptr", DllStructGetPtr($tStream)) Next Local $sOutputString = DllStructGetData($tTempBuffer, 1) MsgBox(0,"",$sOutputString) EndFunc ;==>__ExampleB Saludos
    2 points
  2. AutoBert

    Icon-Viewer

    i have updated an old script named "Icon-Viewer", shortname 'iv' After starting 'iv' search for all DLL's in @Systemdir, and show every dll with 1+ icons in a comboBox. Afaik Shell32 is the most used DLL for, so 'iv' also start with it. Each change of dllCombo clears the Lisview and after showing the Icons for the selected DLL. The Icon's are shown in a Listview with 16 SubItems with Icon and the IconId. The (Main)-Item is reduced to a checkbox which is used to select a Item with all 16 Icons for saving. After selecting all wanted item-rows click "ausgewählte Items speichern" Another way to save a Icon is rightclick on a subItem and after this click "Icon speichern" The path for saving is @UserProfileDir & "\Pictures\Icons", the name for saved files is Dllname_ItemId.ico, Have fun, use/test it and tell me your suggestions. iconLVw7.au3 IconSaver.au3 IconSaver.exe
    1 point
  3. RTFC

    Code Scanner

    Hi Gianni Good questions. The loop-related data is stored in "loops.txt," which is written out to the CS datadump directory only if internal global parameter $fulldump is true and metacode file writing is off (as it's not necessary for MCF processing). By default in GUI and cmdline mode, this boolean is false. You can either run CodeScanner in cmdline mode with explicit parameter /f (or -f) set, or change the call to "_WriteCSDataDump(True)" in Func _AnalyseCode() to always force full output. (NB this will result in an additional query at runtime whether you wish to inspect these files with explorer when written; just press cancel). All conditional statements are called "phrases" in this environment. You can find them in file MCF0_phrased.txt after you run CodeCrypter to produce an encrypted version of your script. For that to work (and for Codecrypter to work on your code at all) you need to add #include "MCFinclude.au3" prior to your code, and (re)run CodeSCanner with writeMCF enabled. In MCF0_phrased, look for "If {phrase", "While {phrase" and/or "Until {phrase"; each line has file and line number references suffices in curly brackets appended. I never intended CodeScanner to produce separate listings of all conditionals (branching points), but the MCF library is able to produce these (see func _PhraseMCF in MCF.au3). You could hook into the MCF library directly with your code, without jumping through CodeCrypter's hoops (in which case, please consult the MetaCode tutorial pdf here). Any more issues, don't hesitate to ask.
    1 point
  4. Ah, I see, looks like I misunderstood the goal of the project.
    1 point
  5. kurtykurtyboy

    AutoIt Snippets

    Here are 2 ways to move a ridiculous amount of GUI controls at once. This could easily be extended to resize at the same time. ;stop window from redrawing, set control positions, allow and redraw the window Func _CtrlsSetPos($hGUI, ByRef $aCtrls, $offsetX = 0, $offsetY = 0) Local $aCurrentPos _SendMessage($hGUI, $WM_SETREDRAW, False) For $i = 0 To UBound($aCtrls) - 1 $aCurrentPos = ControlGetPos(GUICtrlGetHandle($aCtrls[$i]), "", 0) GUICtrlSetPos($aCtrls[$i], $aCurrentPos[0] + $offsetX, $aCurrentPos[1] + $offsetY) Next _SendMessage($hGUI, $WM_SETREDRAW, True) _WinAPI_RedrawWindow($hGUI) EndFunc ;==>_CtrlsSetPos ;move many GUI controls at the same time using Windows' DeferWindowPos structure Func _DeferWindowPos(ByRef $aCtrls, $offsetX = 0, $offsetY = 0) Local $aCurrentPos Local $hDeferWindowPos = _WinAPI_BeginDeferWindowPos(UBound($aCtrls)) For $i = 0 To UBound($aCtrls) - 1 $aCurrentPos = ControlGetPos(GUICtrlGetHandle($aCtrls[$i]), "", 0) _WinAPI_DeferWindowPos($hDeferWindowPos, GUICtrlGetHandle($aCtrls[$i]), Null, $aCurrentPos[0] + $offsetX, $aCurrentPos[1] + $offsetY, 0, 0, $SWP_NOZORDER + $SWP_NOSIZE) Next _WinAPI_EndDeferWindowPos($hDeferWindowPos) EndFunc ;==>_DeferWindowPos
    1 point
  6. Try this one --
    1 point
  7. StringStripWS https://www.purebasic.fr/english/viewtopic.php?t=79183
    1 point
  8. Something like this (untested): Local $oOL_Item = $oOutlook.Session.GetItemFromID($aOL_Item[1][1], Default) Local $oOL_Sender = $oOL_Item.Sender If $oOL_Sender.AddressEntryUserType = $olExchangeUserAddressEntry Or $oOL_Sender.AddressEntryUserType = $olExchangeRemoteUserAddressEntry Then Local $oExchangeUser = $oOL_Sender.GetExchangeUser MsgBox(0, "Mail", $oExchangeUser.PrimarySmtpAddress) EndIf
    1 point
  9. Gee, I don't think you should have either.
    1 point
×
×
  • Create New...