Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/30/2019 in all areas

  1. Yes. (I meant don't try it because there was no exit condition and no parameters for the PixelSearch... aka, it won't do anything)
    1 point
  2. Why? In this forum are dozens of great udfs provided as is. There is no problem in using a udf as is.
    1 point
  3. why would you not use SQL Developer for this? Oracle can already import Excel files. manipulating Oracle Forms is going to probably require you use UIAutomation UDFs in AutoIt. https://www.thatjeffsmith.com/archive/2012/04/how-to-import-from-excel-to-oracle-with-sql-developer/ there are ADO and other database UDFs as well on this Forum
    1 point
  4. Version 0.8.0.0 released Changelog can be found on the download page and the history in the ZIP file. For download please see my signature below. Please play with this version and tell me what doesn't work or is missing!
    1 point
  5. Asked and answered (officially). If the direction is going to change, this is where it will be posted. https://www.autoitscript.com/trac/autoit/wiki/AutoItNotOnToDoList
    1 point
  6. I haven't looked and I don't use MySQL but most probably the various functions in this UDF deal with native AutoIt strings which are Unicode UTF16-LE. In case this is the cause, you can convert wide strings to any codepage (including double-byte types like Big5) and vice-versa with these functions: Func _StringToCodepage($sStr, $iCodepage = Default) If $iCodepage = Default Then $iCodepage = 65001 ; or Int(RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Nls\Codepage", "OEMCP")) Local $aResult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint", $iCodepage, "dword", 0, "wstr", $sStr, "int", StringLen($sStr), _ "ptr", 0, "int", 0, "ptr", 0, "ptr", 0) Local $tCP = DllStructCreate("char[" & $aResult[0] & "]") $aResult = DllCall("Kernel32.dll", "int", "WideCharToMultiByte", "uint", $iCodepage, "dword", 0, "wstr", $sStr, "int", StringLen($sStr), _ "struct*", $tCP, "int", $aResult[0], "ptr", 0, "ptr", 0) Return DllStructGetData($tCP, 1) EndFunc ;==>_StringToCodepage Func _CodepageToString($sCP, $iCodepage = Default) If $iCodepage = Default Then $iCodepage = 65001 ; or Int(RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Nls\Codepage", "OEMCP")) Local $tText = DllStructCreate("byte[" & StringLen($sCP) & "]") DllStructSetData($tText, 1, $sCP) Local $aResult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $iCodepage, "dword", 0, "struct*", $tText, "int", StringLen($sCP), _ "ptr", 0, "int", 0) Local $tWstr = DllStructCreate("wchar[" & $aResult[0] & "]") $aResult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $iCodepage, "dword", 0, "struct*", $tText, "int", StringLen($sCP), _ "struct*", $tWstr, "int", $aResult[0]) Return DllStructGetData($tWstr, 1) EndFunc ;==>_CodepageToString Use the codepage IDs defined there https://docs.microsoft.com/fr-fr/windows/win32/intl/code-page-identifiers For instance, Big5 is 950.
    1 point
  7. an udf I wrote some time ago may be handy for your goal. That udf allows you to run many separate tasks and collect results when are ready. a needed condition for the tasks is that those must be run detached from the main scipt and must allow I/O streams redirection. now, if your tasks are executed by autoit functions instead of external executables, you can still adopt a solution like this: create an "external" autoit script that accepts command line parameters, and returns results back to the caller (a sort of foreign AutoIt function callable from the main script, but runned detached). In this way you can run more instances of that function at a time and collect results while available. Here is how: from the main script use a statement similar to this $hPid = Run(@AutoItExe & ' Ext_Func.au3 Param1 ' & $Param2 & ' $Param3', "", @SW_HIDE, 0x2) ; (0x2) -> $STDOUT_CHILD = Provide a handle to the child's STDOUT stream where Ext_Func.au3 is the external script followed by parameters separated by spaces. In the external script you get parameters by the $CmdLine[] variable and you send results to the caller using the Consolewrite function. (this is performed automatically if you use the MultiTask.udf) Since an example is better than many words (especially if talked by a non-native speaker), here it is: to calculate some of the "hash" you need I've used this nice function by @Danyfirex and I've adapted it a bit so to be an "external" function. Save this function as hash_hmac.au3 in the folder along with your main script. ; by Danyfirex ; see here: https://www.autoitscript.com/forum/topic/191500-hash-hmac/ If $CmdLine[0] < 3 Then Exit ; Read parameters Local $sXkey = $CmdLine[1] ; Key Local $sFile = $CmdLine[2] ; File Path Local $sHash = $CmdLine[3] ; hash algorithm If Not FileExists($sFile) Then Exit If Not StringInStr("|SHA512|SHA256|SHA1|SHA384|MD5|RIPEMD160|", '|' & $sHash & '|') Then Exit Local $hFile = FileOpen($sFile, 16) ; 16 -> $FO_BINARY (16) = Force binary mode Local $oHMAC = ObjCreate("System.Security.Cryptography.HMAC" & $sHash) $oHMAC.key = Binary($sXkey) ; Calculate hash hmac of the file Local $bHash = $oHMAC.ComputeHash_2(FileRead($hFile)) ConsoleWrite($bHash) ; send result to stdout I have also modified/added only small parts of your main script just to allow the use of the MultiTask.udf, leaving everything else unchanged. I leave you the control of your overall logic ... so save also this modified version of your Main script and run it (of course no need to say to also save the MultiTask.udf udf in your folder) Parts I've modified are enclosed between two comment lines like this: ; ========================================================================================================== To see it in action drop some files on the GUI and then hit your "Start calculate" button. ; #RequireAdmin Opt("TrayAutoPause", 0) Opt("MustDeclareVars", 1) #include <WinAPISys.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <GuiListView.au3> #include <Crypt.au3> ; ========================================================================================================== #include 'MultiTask.au3' ; <-- get here: https://www.autoitscript.com/forum/topic/192157-multi-task-easily-run-and-mange-many-processes/ ; ========================================================================================================== #Region Global $hHUI = GUICreate("AutoIT Hash Caculator", 791, 640, 652, 117, -1, BitOR($WS_EX_ACCEPTFILES, $WS_EX_WINDOWEDGE)) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Task 1:", 18, 384, 40, 17) Global $Task1_Label_Status_1 = GUICtrlCreateLabel("DREADY", 73, 384, 55, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task1_Label_Status_2 = GUICtrlCreateLabel("Calculate CRC32", 140, 384, 130, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task1_Label_Status_3 = GUICtrlCreateLabel("", 277, 384, 500, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Task 2:", 18, 416, 40, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task2_Label_Status_1 = GUICtrlCreateLabel("READY", 73, 416, 55, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task2_Label_Status_2 = GUICtrlCreateLabel("Calculate MD2", 140, 416, 130, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task2_Label_Status_3 = GUICtrlCreateLabel("", 277, 416, 500, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Task 3:", 18, 445, 40, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task3_Label_Status_1 = GUICtrlCreateLabel("READY", 73, 445, 55, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task3_Label_Status_2 = GUICtrlCreateLabel("Calculate MD4", 140, 445, 130, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task3_Label_Status_3 = GUICtrlCreateLabel("", 277, 445, 500, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Task 4:", 18, 473, 40, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task4_Label_Status_1 = GUICtrlCreateLabel("READY", 73, 473, 55, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task4_Label_Status_2 = GUICtrlCreateLabel("Calculate MD5 ", 140, 473, 130, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task4_Label_Status_3 = GUICtrlCreateLabel("", 277, 473, 500, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Task 5:", 18, 503, 40, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task5_Label_Status_1 = GUICtrlCreateLabel("READY", 73, 503, 55, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task5_Label_Status_2 = GUICtrlCreateLabel("Calculate SHA1 ", 140, 503, 130, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task5_Label_Status_3 = GUICtrlCreateLabel("", 277, 503, 500, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Task 6:", 18, 530, 40, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task6_Label_Status_1 = GUICtrlCreateLabel("READY", 73, 530, 55, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task6_Label_Status_2 = GUICtrlCreateLabel("Calculate SHA256 ", 140, 530, 130, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task6_Label_Status_3 = GUICtrlCreateLabel("", 277, 530, 500, 17) GUICtrlCreateLabel("Task 7:", 18, 556, 40, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task7_Label_Status_1 = GUICtrlCreateLabel("READY", 73, 556, 55, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task7_Label_Status_2 = GUICtrlCreateLabel("Calculate SHA384 ", 140, 556, 130, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task7_Label_Status_3 = GUICtrlCreateLabel("", 277, 556, 500, 17) GUICtrlCreateLabel("Task 8:", 18, 581, 40, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task8_Label_Status_1 = GUICtrlCreateLabel("READY", 73, 581, 55, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task8_Label_Status_2 = GUICtrlCreateLabel("Calculate SHA512 ", 140, 581, 130, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Task8_Label_Status_3 = GUICtrlCreateLabel("", 277, 581, 500, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Number of tasks running:", 16, 352, 122, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Label_Tasks_Running = GUICtrlCreateLabel("0", 160, 352, 10, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Number of completed files:", 200, 352, 129, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Label_Number_Files_Completed = GUICtrlCreateLabel("0", 336, 352, 42, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Of total files to process: ", 400, 352, 117, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Label_Number_Files_Total = GUICtrlCreateLabel("0", 520, 352, 72, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Button1_Start = GUICtrlCreateButton("Start Calculate ", 512, 8, 123, 33) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Button2_STOP = GUICtrlCreateButton("STOP", 656, 8, 51, 33) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Button3_CLEAR = GUICtrlCreateButton("CLEAR", 720, 8, 51, 33) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Button4_Select_Files = GUICtrlCreateButton("Select file ...", 608, 344, 171, 25) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Group_ListFile = GUICtrlCreateGroup("Drag and Drop files here (this box)", 8, 40, 769, 297, BitOR($GUI_SS_DEFAULT_GROUP, $BS_CENTER)) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $idListview = GUICtrlCreateListView("NUM|STATUS|FILE|CRC32|MD2|MD4|MD5|SHA1|SHA256|SHA384|SHA512", 24, 72, 745, 253) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $Checkbox1_CRC32 = GUICtrlCreateCheckbox("CRC32", 16, 16, 50, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED + $GUI_CHECKED) Global $Checkbox2_MD2 = GUICtrlCreateCheckbox("MD2", 72, 16, 50, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Checkbox3_MD4 = GUICtrlCreateCheckbox("MD4", 128, 16, 50, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Checkbox4_MD5 = GUICtrlCreateCheckbox("MD5", 184, 16, 50, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED + $GUI_CHECKED) Global $Checkbox5_SHA1 = GUICtrlCreateCheckbox("SHA1", 240, 16, 52, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED + $GUI_CHECKED) Global $Checkbox6_SHA256 = GUICtrlCreateCheckbox("SHA256", 296, 16, 60, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED + $GUI_CHECKED) Global $Checkbox7_SHA384 = GUICtrlCreateCheckbox("SHA384", 360, 16, 65, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Checkbox8_SHA256 = GUICtrlCreateCheckbox("SHA256", 440, 16, 73, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $Label_Status = GUICtrlCreateLabel("Status line: All action is completed, ready for the next request!", 16, 608, 757, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW) #EndRegion _WinAPI_ChangeWindowMessageFilterEx($hHUI, $WM_DROPFILES, $MSGFLT_ALLOW) ; Drag and Drop on Admin _WinAPI_ChangeWindowMessageFilterEx($hHUI, $WM_COPYDATA, $MSGFLT_ALLOW) ; Drag and Drop on Admin _WinAPI_ChangeWindowMessageFilterEx($hHUI, $WM_COPYGLOBALDATA, $MSGFLT_ALLOW) ; Drag and Drop on Admin Global $nMsg, $__aDropFiles GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") ; EG DATA TEST GUI START ;~ GUICtrlCreateListViewItem("1|OnProcess|C:\Mikie Hara\Shizuka Nakamura\Buruma Aoi\Satomi Suzuki\Ai Sayama\Nao\Aki Hoshino.MP4|F7331A65|||CCD6116BB67F24905F2B128FBE2B97BA|74BC97D15B9B22649C228BC77D26C7D5011B52B0|EFE6985D1A93D5CDE9E7F5F68AC52AF894B9FC59B3E24B8F635153D526FC940C||", $idListview) ;~ GUICtrlCreateListViewItem("2|OnProcess|C:\Mai Nishida\Suzuka Ishikawa\Ameri Ichinose\Uta Kohaku\The Ca\Noriko Ashiya\Rina Koike.ts|FFFFFFFF|||9F647B59874D8D10CE6F1102D5519C1A|B63F61838E6A93572A0519FF2D0846BCBE6DF370|2774B7FF1108FF9513D6ED1F7F58EFCB0FA30F161246FF2F8E751732560E0902||", $idListview) ;~ GUICtrlCreateListViewItem("3|OnProcess|D:\Megu Fujiura\Rola Takizawa\Maria Ozawa\Ria Sakurai\Shion Utsunomiya\Emiri Suzuhara.mkv|26E70099|||2AB25EC471E53FBF3F241A5D3C51E138|2AA856E6DA6C991094335F64F45138592C451DDF|B0CFCE9490B987EC4359472853BC5007BD345D69475636508E0EB94327CD6669||", $idListview) ;~ GUICtrlCreateListViewItem("4|OnProcess|E:\Saori Hara\Ameri Ichinose\Akiho Yoshizawa\Tsubasa Amami\Risa Tachibana\Tina Yuzuki.mp4|95693338|||CCC322F4B18222858715E22A085659AC|220EB673D4AED9F1652C1CE3D2731CD96A8138F2|044263A3BA067F0967D311782916088BDB723CCC4E15E87FF4B2973E037E593E||", $idListview) ;~ GUICtrlCreateListViewItem("5|OnProcess|F:\Kotone-amamiya\Erika Momotani\Jun Aizawa\Arisa kanno\Yura Sakura\Sana Anjyu (Hina Kurumi).ts|CD5BC9F1|||||||", $idListview) ;~ GUICtrlCreateListViewItem("6|OnProcess|G:\Sora Aoi\Shiori Kamisaki\Takizawa Laura\Rina Ishihara\Rin Higurashi\Aino Kishi\Yui Hatano.mkv||||||||", $idListview) ;~ GUICtrlCreateListViewItem("7|OnProcess|H:\Asuka Ichinose\Anri Sugihara\Ai Shinozaki\Hiyo Nishizuku\Riku Minato\Kirara Asuka\Necoco.MP4||||||||", $idListview) ;~ GUICtrlCreateListViewItem("8|OnProcess|I:\Hina Maeda\Maki Hojo\Yuma Asami\Jessica Kizaki\Kokomi Naruse\Kana Yume\Mihiro Taniguchi.TS||||||||", $idListview) ; EG DATA TEST GUI END ; ========================================================================================================== Local $sFile, $tasks ; ========================================================================================================== While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_DROPPED If ($__aDropFiles[0] > 0) Then For $i = 1 To $__aDropFiles[0] ConsoleWrite($__aDropFiles[$i] & @CRLF) GUICtrlCreateListViewItem($i & "|" & "WAIT|" & $__aDropFiles[$i] & "||||||||", $idListview) Next EndIf Case $Button1_Start ; ========================================================================================================== ; Get filenames directly from the ListView If _GUICtrlListView_GetItemCount($idListview) Then ; for each file run more tasks For $i = 0 To _GUICtrlListView_GetItemCount($idListview) - 1 $sFile = _GUICtrlListView_GetItemText($idListview, $i, 2) ; for each file run 5 tasks _TaskRun($i, @AutoItExe & ' .\hash_hmac.au3' & " MyCriptKey" & " " & $sFile & " MD5", "_SetColumn6") _TaskRun($i, @AutoItExe & ' .\hash_hmac.au3' & " MyCriptKey" & " " & $sFile & " SHA1", "_SetColumn7") _TaskRun($i, @AutoItExe & ' .\hash_hmac.au3' & " MyCriptKey" & " " & $sFile & " SHA256", "_SetColumn8") _TaskRun($i, @AutoItExe & ' .\hash_hmac.au3' & " MyCriptKey" & " " & $sFile & " SHA384", "_SetColumn9") _TaskRun($i, @AutoItExe & ' .\hash_hmac.au3' & " MyCriptKey" & " " & $sFile & " SHA512", "_SetColumn10") Next Do Sleep(250) ; you could perform other jobs here while waiting for the tasks to finish $tasks = _TasksCheckStatus() ; manages the running tasks and get number of tasks still running GUICtrlSetData($Label_Tasks_Running, $tasks) Until Not $tasks ; _TasksCheckStatus() ; <-- this function performs management of running tasks ; and should be called as often as possible MsgBox(0, "Done", "Tasks completed", 2) EndIf ; ========================================================================================================== Case $Button2_STOP Case $Button3_CLEAR ; ========================================================================================================== _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($idListview)) ; empty the listview ; ========================================================================================================== Case $Button4_Select_Files Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _HashFile($sFilePath, $iAlgID, $sIndex = 0) ;~ $CALG_MD2 0x00008001; Hashing algorithm 128-bit ;~ $CALG_MD4 0x00008002; Hashing algorithm 128-bit ;~ $CALG_MD5 0x00008003; Hashing algorithm 128-bit ;~ $CALG_SHA1 0x00008004; Hashing algorithm 160-bit ;~ $CALG_SHA_256 0x0000800c; Hashing algorithm 256-bit ;~ $CALG_SHA_384 0x0000800d; Hashing algorithm 384-bit ;~ $CALG_SHA_512 0x0000800e; Hashing algorithm 512-bit Local $sFileSize = FileGetSize($sFilePath) Local $iTimeInit = TimerInit() Local $dHash = _Crypt_HashFile($sFilePath, $iAlgID) Local $iTimerDiff = TimerDiff($iTimeInit) EndFunc ;==>_HashFile Func _FormatElapsedTime($Input_Seconds = 0) If $Input_Seconds < 1 Then Return 0 $Input_Seconds = $Input_Seconds / 1000 Local $ElapsedMessage = '', $Input = $Input_Seconds, $Minutes, $Hours, $Days Switch $Input_Seconds Case 0 To 59 $ElapsedMessage &= Round($Input, 3) & ' seconds.' Case 60 To 3599 $Minutes = Int($Input / 60) $Input -= ($Minutes * 60) $ElapsedMessage &= $Minutes & ' minutes, ' $ElapsedMessage &= Int($Input) & ' seconds.' Case 3600 To 86399 $Hours = Int($Input / 3600) $Input -= ($Hours * 3600) $ElapsedMessage &= $Hours & ' hours, ' $Minutes = Int($Input / 60) $Input -= ($Minutes * 60) $ElapsedMessage &= $Minutes & ' minutes, ' $ElapsedMessage &= Int($Input) & ' seconds.' Case Else $Days = Int($Input / 86400) $Input -= ($Days * 86400) $ElapsedMessage &= $Days & ' days, ' $Hours = Int($Input / 3600) $Input -= ($Hours * 3600) $ElapsedMessage &= $Hours & ' hours, ' $Minutes = Int($Input / 60) $Input -= ($Minutes * 60) $ElapsedMessage &= $Minutes & ' minutes, ' $ElapsedMessage &= Int($Input) & ' seconds.' EndSwitch Return $ElapsedMessage EndFunc ;==>_FormatElapsedTime Func _ByteSuffix($iBytes, $iRound = 2) ; By Spiff59 Local $a, $aArray[9] = [" B", " KB", " MB", " GB", " TB", " PB", "EB", "ZB", "YB"] While $iBytes > 1023 $a += 1 $iBytes /= 1024 WEnd Return Round($iBytes, $iRound) & $aArray[$a] EndFunc ;==>_ByteSuffix Func WM_DROPFILES($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $ilParam Switch $iMsg Case $WM_DROPFILES Local $aReturn = _WinAPI_DragQueryFileEx($iwParam) If IsArray($aReturn) Then $__aDropFiles = $aReturn Else Local $aError[1] = [0] $__aDropFiles = $aError EndIf EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_DROPFILES ; ========================================================================================================== ; Task's Callback functions ; ------------------------- Func _SetColumn6($aData) _GUICtrlListView_SetItemText($idListview, $aData[0], Binary($aData[1]), 6) ; column 6 MD5 EndFunc ;==>_SetColumn6 Func _SetColumn7($aData) _GUICtrlListView_SetItemText($idListview, $aData[0], Binary($aData[1]), 7) ; column 7 SHA1 EndFunc ;==>_SetColumn7 Func _SetColumn8($aData) _GUICtrlListView_SetItemText($idListview, $aData[0], Binary($aData[1]), 8) ; column 8 SHA256 EndFunc ;==>_SetColumn8 Func _SetColumn9($aData) _GUICtrlListView_SetItemText($idListview, $aData[0], Binary($aData[1]), 9) ; column 9 SHA384 EndFunc ;==>_SetColumn9 Func _SetColumn10($aData) _GUICtrlListView_SetItemText($idListview, $aData[0], Binary($aData[1]), 10) ; column 10 SHA512 EndFunc ;==>_SetColumn10 ; ==========================================================================================================
    1 point
  8. Yes, you absolutely can. Lots of things can be put inside of other things... While True While True While True If PixelSearch() Then While True ConsoleWrite("Hi!") WEnd EndIf WEnd WEnd WEnd (That's an example, don't try it) Loops, functions, and conditionals can all have things inside of them Edit: Also, Welcome!
    1 point
  9. No problem, glad to help, even if it's the slightly cheaty way No, it's better if the file is an exe, then you don't need to worry about executing vs opening the au3 file
    1 point
  10. argumentum

    MailSlot

    why, oh, why. What's wrong with declaring on your PC a mailslot ?, why the workgroup ? On your PC you'd use "\\.\" and if you wanna broadcast to the workgroup, use the same everything but start with "\\*\", that is all
    1 point
  11. dmob

    MailSlot

    Global Const $sMailSlotName = "\\WORKGROUP\mailslot\Test" ... Looks ok for receiver.... How did you define the sender mailslot?
    1 point
  12. willichan

    Inline binary files

    This is a script I banged out for a project where, for some reason, my client's anti-virus program detected any compiled script that used FileInstall() as infected. (They were using some program from China I was not familiar with, nor could I read the messages.) It creates an include file patterned somewhat after the SQLite.dll.au3 that is included with AutoIt. This makes the resulting EXE file a little larger than FileInstall() does (even after /striponly), but it solved my particular problem. It is intended to be compiled, and then drag/drop the binary file onto it to do the conversion. If the dropped file is a DLL file, it will add the DllOpen() and DllClose() commands to the startup and shutdown functions. InlineMe.au3 Const $blocksize = 512 Dim $fromfile, $fromname, $curpos, $tag, $tofile, $toname, $ext, $name If $CmdLine[0] = 0 Then Exit Else $fromname = $CmdLine[1] EndIf If Not FileExists($fromname) Then Exit $toname = $fromname & ".au3" $fromfile = StringToBinary(BinaryToString(FileRead($fromname))) $curpos = 0 $tofile = FileOpen($toname, 2) If $tofile = -1 Then Exit If StringInStr($fromname, ".") Then $ext = StringUpper(StringRight($fromname, StringLen($fromname) - StringInStr($fromname, ".", 0, -1))) Else $ext = "" EndIf $name = StringRight($fromname, StringLen($fromname) - StringInStr($fromname, "\", 0, -1)) FileWriteLine($tofile, '#include-once') FileWriteLine($tofile, '#include <file.au3>') FileWriteLine($tofile, '') FileWriteLine($tofile, 'Func _' & CleanName($name) & '_Startup()') FileWriteLine($tofile, ' Local $Inline_Filename = _TempFile(@TempDir, "~", ".' & $ext & '")') FileWriteLine($tofile, ' Local $InlineOutFile = FileOpen($Inline_Filename, 2)') FileWriteLine($tofile, ' If $InlineOutFile = -1 Then Return SetError(1, 0, "")') FileWriteLine($tofile, '') FileWriteLine($tofile, ' FileWrite($InlineOutFile, _' & CleanName($name) & '_Inline())') FileWriteLine($tofile, ' FileClose($InlineOutFile)') If $ext = "DLL" Then FileWriteLine($tofile, ' If DllOpen($Inline_Filename) = -1 Then') FileWriteLine($tofile, ' Return SetError(1, 0, "")') FileWriteLine($tofile, ' Else') FileWriteLine($tofile, ' Return $Inline_Filename') FileWriteLine($tofile, ' EndIf') Else FileWriteLine($tofile, ' Return $Inline_Filename') EndIf FileWriteLine($tofile, 'EndFunc ;==>_' & CleanName($name) & '_Startup') FileWriteLine($tofile, '') FileWriteLine($tofile, 'Func _' & CleanName($name) & '_Shutdown($Inline_Filename)') If $ext = "DLL" Then FileWriteLine($tofile, ' DllClose($Inline_Filename)') EndIf FileWriteLine($tofile, ' FileDelete($Inline_Filename)') FileWriteLine($tofile, 'EndFunc ;==>_' & CleanName($name) & '_Shutdown') FileWriteLine($tofile, '') FileWriteLine($tofile, 'Func _' & CleanName($name) & '_Inline()') FileWriteLine($tofile, ' Local $sData') FileWriteLine($tofile, " #region ;" & $name) While $curpos < StringLen($fromfile) If $curpos = 0 Then $curpos = 1 $tag = ' $sData = "' Else $tag = ' $sData &= "' EndIf FileWriteLine($tofile, $tag & StringMid($fromfile, $curpos, $blocksize) & '"') $curpos += $blocksize WEnd FileWriteLine($tofile, " #endregion ;" & StringRight($fromname, StringLen($fromname) - StringInStr($fromname, "\", 0, -1))) FileWriteLine($tofile, ' Return Binary($sData)') FileWriteLine($tofile, 'EndFunc ;==>_' & CleanName($name) & '_Inline') FileClose($tofile) Func CleanName($name) $name = StringReplace($name, ".", "") $name = StringReplace($name, " ", "") $name = StringReplace($name, "[", "") $name = StringReplace($name, "]", "") $name = StringReplace($name, "(", "") $name = StringReplace($name, ")", "") $name = StringReplace($name, "{", "") $name = StringReplace($name, "}", "") Return $name EndFunc ;==>CleanName
    1 point
  13. I'm posting the code here frank(we spoke on msn earlier): #include <GUIConstants.au3> $Form1 = GUICreate("Form1", 633, 447, 193, 125, -1, -1, WinGetHandle("Program Manager")) ; <-- creating the window as a child of another window will remove it's entry in the task bar GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
    1 point
×
×
  • Create New...