Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/25/2022 in all areas

  1. You mean like this?? : #Tidy_Parameters = /tcb For $i = 0 To 10 For $i = 0 To 10 For $i = 0 To 10 MsgBox(0, "", 1) MsgBox(0, "", 1) #cs MsgBox(0, "", 1) #ce MsgBox(0, "", 1) MsgBox(0, "", 1) Next Next Next
    1 point
  2. Musashi

    Check MD5 Large Files

    Here the Default way and a Speed variant (by @trancexx ) EDIT : Additional info : I have applied the Default and the Speed variant on a 6 GB file. The Speed variant throws an error (I assume for files > 2 GB). The directive #AutoIt3Wrapper_UseX64 = Y ensures that the error message of the Speed variant disappears, but the hash then differs from the Default variant. You should check externally which MD5 hash is the correct one and then add a switch for the respective variant for files > 2 GB. #include <Crypt.au3> Opt('MustDeclareVars', 1) ; Filename (full path) Global $sFilename = @ScriptDir & '\Test.mp4' Global $dMD5Hash Global $fTimerStart, $fTimerEnd ; *** just info ; ----------------------------------------- ; Default : ; ----------------------------------------- $fTimerStart = TimerInit() ; *** just info _Crypt_Startup() $dMD5Hash = _Crypt_HashFile($sFilename, $CALG_MD5) If @error Then ConsoleWrite('@@ Error = <' & @error & '>' & @CRLF) Else ConsoleWrite('@@ MD5 Hash = <' & Hex($dMD5Hash) & '>' & @CRLF) EndIf _Crypt_Shutdown() $fTimerEnd = TimerDiff($fTimerStart) ; *** just info ConsoleWrite("Default -> Time : " & $fTimerEnd & @CRLF) ; ----------------------------------------- ; Speedversion : Uses virtual RAM ; ----------------------------------------- $fTimerStart = TimerInit() ; *** just info $dMD5Hash = _HashFile_MD5VMem($sFilename) If @error Then ConsoleWrite('@@ Error V = <' & @error & '>' & @CRLF) Else ConsoleWrite('@@ MD5 V Hash = <' & Hex($dMD5Hash) & '>' & @CRLF) EndIf $fTimerEnd = TimerDiff($fTimerStart) ; *** just info ConsoleWrite("Virtual -> Time : " & $fTimerEnd & @CRLF) ; #FUNCTION# ;=============================================================================== ; ; Name : _HashFile_MD5VMem ; Beschreibung : - Calculates MD5 value for the specific file. ; - Speedversion : Uses virtual RAM ; - max. Filesize depends on free RAM ; Returns : Success : @error = 0 , MD5-Hash ; Error : @error <> 0 , empty value ; ; Author ........: trancexx ; see www.autoitscript.com/forum/topic/95558-crc32-md4-md5-sha1-for-files/?page=1 ;====================================1====================================================== Func _HashFile_MD5VMem($sFile) Local $ahCall , $hFile , $hFileMappingObject, $pFile Local $iBufferSize, $tMD5_CTX $ahCall = DllCall("kernel32.dll", "hwnd", "CreateFileW", _ "wstr", $sFile, _ "dword", 0x80000000, _ "dword", 3, _ "ptr", 0, _ "dword", 3, _ "dword", 0, _ "ptr", 0) If @error Or $ahCall[0] = -1 Then Return SetError(1, 0, "") EndIf $hFile = $ahCall[0] $ahCall = DllCall("kernel32.dll", "ptr", "CreateFileMappingW", _ "hwnd", $hFile, _ "dword", 0, _ "dword", 2, _ "dword", 0, _ "dword", 0, _ "ptr", 0) If @error Or Not $ahCall[0] Then DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFile) Return SetError(2, 0, "") EndIf DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFile) $hFileMappingObject = $ahCall[0] $ahCall = DllCall("kernel32.dll", "ptr", "MapViewOfFile", _ "hwnd", $hFileMappingObject, _ "dword", 4, _ "dword", 0, _ "dword", 0, _ "dword", 0) If @error Or Not $ahCall[0] Then DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) Return SetError(3, 0, "") EndIf $pFile = $ahCall[0] $iBufferSize = FileGetSize($sFile) $tMD5_CTX = DllStructCreate("dword i[2];" & _ "dword buf[4];" & _ "ubyte in[64];" & _ "ubyte digest[16]") DllCall("advapi32.dll", "none", "MD5Init", "ptr", DllStructGetPtr($tMD5_CTX)) If @error Then DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pFile) DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) Return SetError(4, 0, "") EndIf DllCall("advapi32.dll", "none", "MD5Update", _ "ptr", DllStructGetPtr($tMD5_CTX), _ "ptr", $pFile, _ "dword", $iBufferSize) If @error Then DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pFile) DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) Return SetError(5, 0, "") EndIf DllCall("advapi32.dll", "none", "MD5Final", "ptr", DllStructGetPtr($tMD5_CTX)) If @error Then DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pFile) DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) Return SetError(6, 0, "") EndIf DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pFile) DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) Return SetError(0, 0, DllStructGetData($tMD5_CTX, "digest")) EndFunc ;==>_HashFile_MD5VMem
    1 point
  3. In SciTE you can use the "SciTE Config for AutoIt" tool to set a user defined directory for all of your UDFs. Press Ctrl+1 and set "User Include Folder" to the directory where you keep all of your UDFs. So when you install a new version of AutoIt nothing gets lost.
    1 point
  4. @Letraindusoir If I'm interpreting your question correctly, you are trying to retrieve the URL associated with a hyperlink. If so, then you might want to try something like this -- _WD_ElementAction($sSession, $sElement, 'attribute', 'href')
    1 point
  5. Malkey

    Old style drag window

    This working example of the script copied from here by Siao may help. #include <GUIConstantsEx.au3> #include <Misc.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) ;~ Global Const $WM_ENTERSIZEMOVE = 0x231 Global Const $WM_EXITSIZEMOVE = 0x232 ;~ Global Const $WM_SETREDRAW = 0x000B ;Const $WM_SYSCOMMAND = 0x0112 Const $SC_MOVE = 0xF010 Const $SC_SIZE = 0xF000 Global $OldParam $parent = GUICreate("GUI", 200, 400, -1, -1, $WS_SIZEBOX) ;~ GUIRegisterMsg($WM_ENTERSIZEMOVE, "WM_ENTERSIZEMOVE") GUIRegisterMsg($WM_EXITSIZEMOVE, "WM_EXITSIZEMOVE") GUIRegisterMsg($WM_SYSCOMMAND, "On_WM_SYSCOMMAND") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $Button = GUICtrlCreateButton("Button", 50, 100, 100, 21) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func On_WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam) Switch BitAND($wParam, 0xFFF0) Case $SC_MOVE, $SC_SIZE ;Const $SPI_SETDRAGFULLWINDOWS = 37 ;Const $SPI_GETDRAGFULLWINDOWS = 38 ;Const SPIF_SENDWININICHANGE = 2 $tBool = DllStructCreate("int") DllCall("user32.dll", "int", "SystemParametersInfo", "int", 38, "int", 0, "ptr", DllStructGetPtr($tBool), "int", 0) $OldParam = DllStructGetData($tBool, 1) DllCall("user32.dll", "int", "SystemParametersInfo", "int", 37, "int", 0, "ptr", 0, "int", 2) EndSwitch EndFunc ;==>On_WM_SYSCOMMAND Func WM_EXITSIZEMOVE() DllCall("user32.dll", "int", "SystemParametersInfo", "int", 37, "int", $OldParam, "ptr", 0, "int", 2) EndFunc ;==>WM_EXITSIZEMOVE Func _Exit() Exit EndFunc ;==>_Exit
    1 point
×
×
  • Create New...