Jump to content

Leaderboard

Popular Content

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

  1. It is, as far as I know, not possible to use a regular expression as a filter in _FileListToArray(Rec). Here is a variation with FileFindFirstFile and FileFindNextFile (will also match video001). I moved the array from the function to the global scope too. In the attachment you will find a Zip with test files (dummies only). Like in your script the subfolders \music , \picture and \video are used. #include <File.au3> Global $g_sFileDir Global $g_aArr[3] = ["music", "picture", "video"] For $i = 0 To UBound($g_aArr) - 1 $g_sFileDir = @ScriptDir & "\" & $g_aArr[$i] & "\" ConsoleWrite("< "& $g_aArr[$i] & " -> highest number = " & _GetFileHighNum($g_sFileDir, $g_aArr[$i]) & @CRLF) Next ; --------------------------------------------------------------------- Func _GetFileHighNum($sFileDir, $sSearchName) Local $hSearch, $sCurrentFile, $iMaxNum = 0, $iNum = 0 $hSearch = FileFindFirstFile($sFileDir & $sSearchName & '*') If $hSearch = -1 Then Return 0 While 1 $sCurrentFile = FileFindNextFile($hSearch) If @error Then FileClose($hSearch) Return $iMaxNum EndIf If StringRegExp($sCurrentFile, '(?i)^' & $sSearchName & '\d{3}$') Then $iNum = Number(StringRegExpReplace($sCurrentFile, '\D', '')) If (Not @error) And ($iNum >= $iMaxNum) Then $iMaxNum = $iNum EndIf WEnd EndFunc ;==>_GetFileHighNum TestFolders.zip
    2 points
  2. WHAT : is .NET Common Language Runtime (CLR) Framework The Common Language Runtime (CLR) is a an Execution Environment . Common Language Runtime (CLR)'s main tasks are to convert the .NET Managed Code to native code, manage running code like a Virtual Machine, and also controls the interaction with the Operating System. As part of Microsoft's .NET Framework, the Common Language Runtime (CLR) is managing the execution of programs written in any of several supported languages. Allowing them to share common object-oriented classes written in any of the languages. HOW : To access the CLR environment you need to create an Appdomain Object - _CLR_GetDefaultDomain() An AppDomain provides an isolated region in which code runs inside of an existing process. Application domains provide an isolation boundary for security, reliability, and versioning, and for unloading assemblies. Application domains are typically created by runtime hosts, which are responsible for bootstrapping the common language runtime before an application is run. WHEN : Would you use CLR Runtime Hosts 1. To access .NET Class Libraries : System System.Collections System.Data System.Drawing System.IO System.Text System.Threading System.Timers System.Web System.Web.Services System.Windows.Forms System.Xml 2. Accessing custom build .Net Assemblies : Some Examples (but there are a ton out there) AutoItX3 - The .NET Assembly for using AutoItX JSonToXML libr. XMLRPC Libr. .NETPDF libr. .NETOCR Libr WInSCP Libr. ... 3. To Compile .Net Code into an Assembly 4. To Run C# or VB.net Code 5. To Mix AU3 and .Net functionality in your Application WHERE : To find documentation about CLR First of all you can find a lot on MSDN and here : Post 4 & Post 6 EXAMPLES : Multiple examples included in Zip !! Example : “System.Text.UTF8Encoding” Example : “System.IO.FileInfo” Example : “System.Windows.Forms” Example : AutoItX3 Custom .NET Assembly AutoItX Example : Compile Code C# and Code VB Example : Compile Code C# at Runtime WHO : Created the CLR.au3 UDF All credits go to : Danyfirex / Larsj / Trancexx / Junkew TO DO : The library is still Work in Process … (Some of the GUI Controls are not yet working as expected...) Anyone is free to participate in contributing to get the bugs resolved and to expand the CLR.au3 functionality ... Enjoy !! DOWNLOADS : (Last updated) - added CLR Constants.au3 - Danyfirex - Global Constants added (Magic numbers) - added .NET CLR CreateObject vs ObjCreate Example.au3 - Junkew • 2 approaches give the same result (only valid for COM Visible Assembly) • Includes a function that shows you which Assembly Classes are COM Visible - added .Net Conventional COM Objects Examples - ptrex - added .NET CLR CreateComInstanceFrom Example - Danyfirex - You can use it for Regfree COM Assembly Access - System.Activator has 4 methods : • CreateComInstanceFrom : Used to create instances of COM objects. • CreateInstanceFrom : Used to create a reference to an object from a particular assembly and type name. • GetObject : Used when marshaling objects. • CreateInstance : Used to create local or remote instances of an object. - added .NET Access SafeArrays Using AccVarsUtilities Example - LarsJ - added SafeArray Utilities functions in Includes - LarsJ - added .NET Access Native MSCorLib Classes - System - ptrex Multiple System Class Examples : • System.Random • System.DateTime • System.Diagnostics.PerformanceCounter • System.IO.FileInfo • System.Int32 • System.Double • System.Speech • System.Web - added Third Party Assembly Access - ptrex • WinSCP : https://winscp.net/eng/download.php • IonicZip : http://dotnetzip.codeplex.com/ - added more Examples using PowerShell GUI Assembly Access - ptrex • GUI Ribbon .NET Assembly using &nbsp;CLR Library • GUI Report Designer .NET Assembly using &nbsp;CLR Library • GUI SSRS Reporting .NET Assembly using &nbsp;CLR Library CLRv3a.zip .NET CLR Framework for AutoIT.pdf
    1 point
  3. @CYCho There are two options that I would suggest that you research further -- Place the text on the clipboard and then paste it with Ctrl+V Use _WD_ExecuteScript along with the appropriate javascript to update the control directly
    1 point
  4. don't use send, if you're using IE use the IE UDF to do it. I doubt that there's no other way to get it accomplished other than using Send.
    1 point
  5. BTW, I would never implicitly trust a self-signed certificate, and neither should ANY AV company. If it doesn't come from a reputable certificate issuer, then it's not worth the metaphorical paper it's written on. Just because someone with Admin rights has installed such a cert (self-signed) doesn't mean that the cert in question is secure, in any way shape or form, it just means someone that has admin credentials installed it.
    1 point
  6. Sorry I can't offer code, but perhaps I can offer some information, apologies if this repeats what you have already figured out: I'm not aware that any of the algorithms you are looking at can be conventionally calculated in a parallel environment for a single file. Exceptions being a non-conventional version of md5 which is not portable (sorry can't remember the details) and a possible technique to split the file process and the checksum process into two threads (sounds impossible within AutoIt). So lets assume you are splitting the job by a file with one checksum operation per thread. So you now have a job queue that looks something like this: File A - CRC32 File A - SHA5 File B - CRC32 File C - SHA5 Each one of these in a separate thread. So all you need to do is build a very basic job queuing system for however many cores you have available e.g. an array that you keep taking the last job from would do. The way this is most likely to disappoint is the volume of file data you are trying to load into memory at the same time, it will probably choke on the I/O. Depending on your algorithms, file sizes and hardware, there may be options to deliberately delay launching the separate processes or controlling running processes to stagger the I/O access versus CPU time. I've not done any parallel work with AutoIt, but a quick search turned up these options Choose a core to launch on https://www.autoitscript.com/forum/topic/70395-running-a-process-on-a-specific-core/ Communicate between processes https://www.autoitscript.com/forum/topic/179457-interprocess-communication-help/ You may not even need inter-processor comms as you could just use a flat file of jobs that all your processes pick up tasks from (delete the task from the list once collected). Obviously, care with file locking. Personally, I'm so lazy I would just skip the whole parallel coding side and run the application 6 times and manually load each one up with a subset of jobs. I hope that gives some ideas anyway.
    1 point
  7. You're in luck 😀 I was looking for similar functionality and found this script on the forum. Sadly, I can't remember who wrote it... #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <array.au3> #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <APIConstants.au3> #include <WinAPIEx.au3> _GDIPlus_Startup() $hGUI = GUICreate("Absent Capture", 675, 170) $cButton_CheckAll = GUICtrlCreateButton("Check All", 10, 145, 100, 20) $cButton_UncheckAll = GUICtrlCreateButton("UnCheck All", 120, 145, 100, 20) $cButton_StatesToArray = GUICtrlCreateButton("States to Array", 222, 145, 100, 20) $cListView = GUICtrlCreateListView("", 2, 2, 667, 120, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS)) $hListView = GUICtrlGetHandle($cListView) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)) $hIml_Listview = _GUIImageList_Create(16, 16, 5, 3) $hBitmap_Icon = _Load_BMP_From_Mem(_Icon_Image_Checkbox_Unchecked(), True) _GUIImageList_Add($hIml_Listview, $hBitmap_Icon) _WinAPI_DeleteObject($hBitmap_Icon) $hBitmap_Icon = _Load_BMP_From_Mem(_Icon_Image_Checkbox_Checked(), True) _GUIImageList_Add($hIml_Listview, $hBitmap_Icon) _WinAPI_DeleteObject($hBitmap_Icon) _GUICtrlListView_SetImageList($hListView, $hIml_Listview, 1) ; Add columns _GUICtrlListView_AddColumn($hListView, " Name", 175, 0) For $c = 1 To 21 _GUICtrlListView_AddColumn($hListView, $c, 22 + ($c>9 ? 2 : 0), 0) Next ; Add items _GUICtrlListView_AddItem($hListView, "Mathinjwa, Oluhle S", 0) _GUICtrlListView_SetItemImage($hListView, 0, 10, 0) For $c = 1 To 21 _GUICtrlListView_AddSubItem($hListView, 0, " ", $c, 0) Next _GUICtrlListView_AddItem($hListView, "Maphumulo, Siphiwokuhle", 0) _GUICtrlListView_SetItemImage($hListView, 1, 10, 0) For $c = 1 To 21 _GUICtrlListView_AddSubItem($hListView, 1, " ", $c, 0) Next _GUICtrlListView_AddItem($hListView, "MNGOMEZULU, Mqobi Kazimoto", 0) _GUICtrlListView_SetItemImage($hListView, 2, 10, 0) For $c = 1 To 21 _GUICtrlListView_AddSubItem($hListView, 2, " ", $c, 0) Next GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState() ; Loop until user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $cButton_CheckAll _LV_ImgCheckboxes_CheckAll($hListView) Case $cButton_UncheckAll _LV_ImgCheckboxes_UncheckAll($hListView) Case $cButton_StatesToArray $aLVStates = _LV_ImgCheckboxes_StatesToArray($hListView) _ArrayDisplay($aLVStates) EndSwitch WEnd GUIDelete() _GUIImageList_Destroy($hIml_Listview) _GDIPlus_Shutdown() Exit Func _LV_ImgCheckboxes_CheckAll($hWnd) _GUICtrlListView_BeginUpdate($hWnd) For $i = 0 To _GUICtrlListView_GetItemCount($hWnd) - 1 For $y = 0 To _GUICtrlListView_GetColumnCount($hWnd) - 1 _GUICtrlListView_SetItemImage($hWnd, $i, 1, $y) Next Next _GUICtrlListView_EndUpdate($hWnd) EndFunc ;==>_LV_ImgCheckboxes_CheckAll Func _LV_ImgCheckboxes_UncheckAll($hWnd) _GUICtrlListView_BeginUpdate($hWnd) For $i = 0 To _GUICtrlListView_GetItemCount($hWnd) - 1 For $y = 0 To _GUICtrlListView_GetColumnCount($hWnd) - 1 _GUICtrlListView_SetItemImage($hWnd, $i, 0, $y) Next Next _GUICtrlListView_EndUpdate($hWnd) EndFunc ;==>_LV_ImgCheckboxes_UncheckAll Func _LV_ImgCheckboxes_StatesToArray($hWnd) Local $iColumns = _GUICtrlListView_GetColumnCount($hWnd) If $iColumns = 0 Then Return SetError(1) Local $iItems = _GUICtrlListView_GetItemCount($hWnd) If $iItems = 0 Then Return SetError(2) Local $aStates[$iItems][$iColumns] For $i = 0 To $iItems - 1 For $y = 0 To $iColumns - 1 $aStates[$i][$y] = _GUICtrlListView_GetItemImage($hWnd, $i, $y) Next Next Return $aStates EndFunc ;==>_LV_ImgCheckboxes_StatesToArray Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom") Local $nNotifyCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hListView Switch $nNotifyCode Case $NM_CUSTOMDRAW ; http://www.autoitscript.com/forum/topic/123757-focushighlight-a-certain-item-in-a-listview/page__view__findpost__p__859598 ; Mat & Siao If Not _GUICtrlListView_GetViewDetails($hWndFrom) Then Return $GUI_RUNDEFMSG ; Not in details mode Local $tCustDraw, $iDrawStage, $iItem, $iSubitem, $hDC, $tRect, $iColor1, $iColor2, $iColor3 $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) $iDrawStage = DllStructGetData($tCustDraw, 'dwDrawStage') Switch $iDrawStage Case $CDDS_PREPAINT Return $CDRF_NOTIFYITEMDRAW Case $CDDS_ITEMPREPAINT Return $CDRF_NOTIFYSUBITEMDRAW Case $CDDS_ITEMPOSTPAINT ; Not handled Case BitOR($CDDS_ITEMPREPAINT, $CDDS_SUBITEM) Local $iItem = DllStructGetData($tCustDraw, 'dwItemSpec') Local $iSubitem = DllStructGetData($tCustDraw, 'iSubItem') If $iSubitem > 0 And _GUICtrlListView_GetItemSelected($hWndFrom, $iItem) Then ; Item to draw is selected Local $hDC = _WinAPI_GetDC($hWndFrom) Local $tRect = DllStructCreate($tagRECT) Local $pRect = DllStructGetPtr($tRect) ; We draw the background when we draw the first item. If $iSubitem = 0 Then ; We must send the message as we want to use the struct. _GUICtrlListView_GetSubItemRect returns an array. _SendMessage($hWndFrom, $LVM_GETSUBITEMRECT, $iItem, $pRect) DllStructSetData($tRect, "Left", 0) _WinAPI_FillRect($hDC, DllStructGetPtr($tRect), _WinAPI_GetStockObject(0)) ; NULL_PEN to overwrite default highlighting EndIf DllStructSetData($tRect, "Left", 2) DllStructSetData($tRect, "Top", $iSubitem) _SendMessage($hWndFrom, $LVM_GETSUBITEMRECT, $iItem, DllStructGetPtr($tRect)) Local $sText = _GUICtrlListView_GetItemText($hWndFrom, $iItem, $iSubitem) _WinAPI_SetBkMode($hDC, $TRANSPARENT) ; It uses the background drawn for the first item. ; Select the font we want to use _WinAPI_SelectObject($hDC, _SendMessage($hWndFrom, $WM_GETFONT)) Local $hIcon = _GUIImageList_GetIcon($hIml_Listview, _GUICtrlListView_GetItemImage($hListView, $iItem, $iSubitem)) ;~ If $iSubitem = 0 Then ;~ _WinAPI_DrawIconEx($hDC, DllStructGetData($tRect, "Left") - 16, DllStructGetData($tRect, "Top") + 1, $hIcon, 16, 16) ;~ DllStructSetData($tRect, "Left", DllStructGetData($tRect, "Left") + 2) ;~ Else ;~ _WinAPI_DrawIconEx($hDC, DllStructGetData($tRect, "Left"), DllStructGetData($tRect, "Top") + 1, $hIcon, 16, 16) ;~ DllStructSetData($tRect, "Left", DllStructGetData($tRect, "Left") + 6 + 18) ;~ EndIf If $iSubitem = 0 Then _GUICtrlListView_SetItemImage($hListView, $iItem, 10, 0) Else _WinAPI_DrawIconEx($hDC, DllStructGetData($tRect, "Left"), DllStructGetData($tRect, "Top") + 1, $hIcon, 16, 16) DllStructSetData($tRect, "Left", DllStructGetData($tRect, "Left") + 6 + 18) EndIf _GUIImageList_DestroyIcon($hIcon) _WinAPI_DrawText($hDC, $sText, $tRect, BitOR($DT_VCENTER, $DT_END_ELLIPSIS, $DT_SINGLELINE)) _WinAPI_ReleaseDC($hWndFrom, $hDC) Return $CDRF_SKIPDEFAULT ; Don't do default processing EndIf _GUICtrlListView_SetItemImage($hListView, $iItem, 10, 0) Return $CDRF_NEWFONT ; Let the system do the drawing for non-selected items Case BitOR($CDDS_ITEMPOSTPAINT, $CDDS_SUBITEM) ; Not handled EndSwitch Case $NM_CLICK Local $tINFO = DllStructCreate($tagNMITEMACTIVATE, $lParam) Local $iItem = DllStructGetData($tINFO, "Index") Local $iSubitem = DllStructGetData($tINFO, "SubItem") _GUICtrlListView_SetItemImage($hListView, $iItem, Not _GUICtrlListView_GetItemImage($hListView, $iItem, $iSubitem), $iSubitem) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ; Based on File to Base64 String Code Generator ; by UEZ ; http://www.autoitscript.com/forum/topic/134350-file-to-base64-string-code-generator-v103-build-2011-11-21/ ;====================================================================================== ; Function Name: Load_BMP_From_Mem ; Description: Loads an image which is saved as a binary string and converts it to a bitmap or hbitmap ; ; Parameters: $bImage: the binary string which contains any valid image which is supported by GDI+ ; Optional: $hHBITMAP: if false a bitmap will be created, if true a hbitmap will be created ; ; Remark: hbitmap format is used generally for GUI internal images, $bitmap is more a GDI+ image format ; Don't forget _GDIPlus_Startup() and _GDIPlus_Shutdown() ; ; Requirement(s): GDIPlus.au3, Memory.au3 and _GDIPlus_BitmapCreateDIBFromBitmap() from WinAPIEx.au3 ; Return Value(s): Success: handle to bitmap (GDI+ bitmap format) or hbitmap (WinAPI bitmap format), ; Error: 0 ; Error codes: 1: $bImage is not a binary string ; 2: unable to create stream on HGlobal ; 3: unable to create bitmap from stream ; ; Author(s): UEZ ; Additional Code: thanks to progandy for the MemGlobalAlloc and tVARIANT lines and ; Yashied for _GDIPlus_BitmapCreateDIBFromBitmap() from WinAPIEx.au3 ; Version: v0.97 Build 2012-01-04 Beta ;======================================================================================= Func _Load_BMP_From_Mem($bImage, $hHBITMAP = False) If Not IsBinary($bImage) Then Return SetError(1, 0, 0) Local $aResult Local Const $memBitmap = Binary($bImage) ;load image saved in variable (memory) and convert it to binary Local Const $len = BinaryLen($memBitmap) ;get length of image Local Const $hData = _MemGlobalAlloc($len, $GMEM_MOVEABLE) ;allocates movable memory ($GMEM_MOVEABLE = 0x0002) Local Const $pData = _MemGlobalLock($hData) ;translate the handle into a pointer Local $tMem = DllStructCreate("byte[" & $len & "]", $pData) ;create struct DllStructSetData($tMem, 1, $memBitmap) ;fill struct with image data _MemGlobalUnlock($hData) ;decrements the lock count associated with a memory object that was allocated with GMEM_MOVEABLE $aResult = DllCall("ole32.dll", "int", "CreateStreamOnHGlobal", "handle", $pData, "int", True, "ptr*", 0) ;Creates a stream object that uses an HGLOBAL memory handle to store the stream contents If @error Then SetError(2, 0, 0) Local Const $hStream = $aResult[3] $aResult = DllCall($__g_hGDIPDll, "uint", "GdipCreateBitmapFromStream", "ptr", $hStream, "int*", 0) ;Creates a Bitmap object based on an IStream COM interface If @error Then SetError(3, 0, 0) Local Const $hBitmap = $aResult[2] Local $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data; ptr") DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "dword", 8 + 8 * @AutoItX64, _ "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) ;release memory from $hStream to avoid memory leak $tMem = 0 $tVARIANT = 0 If $hHBITMAP Then Local Const $hHBmp = _GDIPlus_BitmapCreateDIBFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBmp EndIf Return $hBitmap EndFunc ;==>_Load_BMP_From_Mem ;~ Func _GDIPlus_BitmapCreateDIBFromBitmap($hBitmap) ;~ Local $tBIHDR, $Ret, $tData, $pBits, $hResult = 0 ;~ $Ret = DllCall($__g_hGDIPDll, 'uint', 'GdipGetImageDimension', 'ptr', $hBitmap, 'float*', 0, 'float*', 0) ;~ If (@error) Or ($Ret[0]) Then Return 0 ;~ $tData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $Ret[2], $Ret[3], $GDIP_ILMREAD, $GDIP_PXF32ARGB) ;~ $pBits = DllStructGetData($tData, 'Scan0') ;~ If Not $pBits Then Return 0 ;~ $tBIHDR = DllStructCreate('dword;long;long;ushort;ushort;dword;dword;long;long;dword;dword') ;~ DllStructSetData($tBIHDR, 1, DllStructGetSize($tBIHDR)) ;~ DllStructSetData($tBIHDR, 2, $Ret[2]) ;~ DllStructSetData($tBIHDR, 3, $Ret[3]) ;~ DllStructSetData($tBIHDR, 4, 1) ;~ DllStructSetData($tBIHDR, 5, 32) ;~ DllStructSetData($tBIHDR, 6, 0) ;~ $hResult = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'hwnd', 0, 'ptr', DllStructGetPtr($tBIHDR), 'uint', 0, 'ptr*', 0, 'ptr', 0, 'dword', 0) ;~ If (Not @error) And ($hResult[0]) Then ;~ DllCall('gdi32.dll', 'dword', 'SetBitmapBits', 'ptr', $hResult[0], 'dword', $Ret[2] * $Ret[3] * 4, 'ptr', DllStructGetData($tData, 'Scan0')) ;~ $hResult = $hResult[0] ;~ Else ;~ $hResult = 0 ;~ EndIf ;~ _GDIPlus_BitmapUnlockBits($hBitmap, $tData) ;~ Return $hResult ;~ EndFunc ;==>_GDIPlus_BitmapCreateDIBFromBitmap Func _Decompress_Binary_String_to_Bitmap($Base64String) $Base64String = Binary($Base64String) Local $iSize_Source = BinaryLen($Base64String) Local $pBuffer_Source = _WinAPI_CreateBuffer($iSize_Source) DllStructSetData(DllStructCreate('byte[' & $iSize_Source & ']', $pBuffer_Source), 1, $Base64String) Local $pBuffer_Decompress = _WinAPI_CreateBuffer(8388608) Local $Size_Decompressed = _WinAPI_DecompressBuffer($pBuffer_Decompress, 8388608, $pBuffer_Source, $iSize_Source) Local $b_Result = Binary(DllStructGetData(DllStructCreate('byte[' & $Size_Decompressed & ']', $pBuffer_Decompress), 1)) _WinAPI_FreeMemory($pBuffer_Source) _WinAPI_FreeMemory($pBuffer_Decompress) Return $b_Result EndFunc ;==>_Decompress_Binary_String_to_Bitmap Func _Icon_Image_Checkbox_Unchecked() Local $Base64String $Base64String &= '7rBIAAABABAQEAFwCAAAaAUAABYAAMwAKAAYAJAAIAAYAVwZAQBAAQIYDgCAgAAAANfc3ADZ3t4AANvg4ADe4uIAAOLl5QDl6OgAAOns7ADs7+8AAO/x8QDx8/MAAPT19QD29/cAAPj5+QD6+/sAAPz9/QD+/v7wAP///xNc/wB/AD8A/z8APwA/AD8APwA/AD8ACAAb4HYLAAEJAOEBCgsMAA0ODxAREhISbeIBCQcC4gEIBwLiAQfbBwLiAQYHAuIBBQcC4gG2BAcC4gEDBwLiAQIHAv/jAQcC5AEGAuIB7BceAOCfHgN/AG0A4QZhAA==' Return _Decompress_Binary_String_to_Bitmap(_Base64Decode($Base64String)) EndFunc ;==>_Icon_Image_Checkbox_Unchecked Func _Icon_Image_Checkbox_Checked() Local $Base64String ;$Base64String &= 'z7BIAAABABAQEAFwCAAAaAUAABYAAMwAKAAYAJAAIAAYAVwZAQBAAQIYDgCAgAAAAISEhADe3t5AAN7n5wDnAQbvCO8A7wEG9/cA9/EABv///xN4/wE/AD8A/z8APwA/AD8AHwAMAOB6CwAGAQkA4QEHCAkJCR4KAgDjAQcC5AEHCAKDAwLiAQYHBwICAwI54gEFBsABAwLjAQUCxgIkBOIBBAUCRQbjAVgEBQUCAuQBAwUCCPPkAQUCBwjkAQYC4gHsF3seAOCfA38AbQDhBmEA' $Base64String &= 'YbJIAAABABAQEAFwIAAAaAQAABYAAHwAKAAYAJAAiAO4FQD/hP//SgYAAPHsAAOrAAgFA+8EA+0BA+0bOwD17Bog9f88TAD5/zpJ+P84RwD4/zVF+P80QwD3/zJC9/8UGwkBT+3oEzv37B0jAPn/RFP6/yQpAPn/EhL3/w8PAPb/DAz1/wkJgPX/Fhv1/zOAIwGRIQAA+ewfJfoA/0pY+/9CR/sA/8nJ/f87O/kA/xMT9/8QEPYA/zMz9//Fxf2A/zA19/80RIEhAvKKIQAA+/9PXQD9/zI3+//LywD+//Ly///r6wL+giE5Ofj/6uog/v/x8f6CIRgdD4AngEOBiYcf/f9SXwD9/ygo/P9HR2D8/+zs/4IhgQPsCuyBHf+CITQ09/8YCwv1gomNH1Vi/gD/LCz9/ykp/OD/SEj8/0FawRDDEZD+/zo6x0Q4SMEPAwAVyA9XZP7/MDAA/f8tLf3/S0sBzQ///z09+f8WJBb4wkQ8S80P//8IWmf+wEn+/1BQ4v3CDvPz/8IBxRHBIAA+Pvr/Fxf4/wg/TvnOD1to//9AQ0f+/8/Pxw5MIEz8/0pKx0PKygD+/yov+v9CUQ76AA0ACccP6yYr/wD/XWr//1hb/wHCEFJS/v8vL/0DwkTBM8zM/v9ITMD7/0lX+//BicCaRuvLgMcQQ0f/wFr+iP8yMsdEODz8wHg8/P/BicCayg7NEFxpA8MzwURYZf7/VmMA/v9UYf7/Iifa/AAJ+0Ay2cD/wM8BAj3FAP3JAEBC/+hrAAAAAPAPAADgBwAAwMADAACAAXsAYQQHYQVhBmEH' Return _Decompress_Binary_String_to_Bitmap(_Base64Decode($Base64String)) EndFunc ;==>_Icon_Image_Checkbox_Checked Func _Base64Decode($input_string) Local $struct = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(1, 0, "") Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]") $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(2, 0, "") Return DllStructGetData($a, 1) EndFunc ;==>_Base64Decode You will need some modification. I modified it to show some other icon in first column.
    1 point
  8. Maybe something like this would work? Not tested, and may need to be adjusted to fit your needs. For $i = 0 To UBound($sPC) - 1 Local $sVersion2 = "0.0.0", $sVersion = FileGetVersion('\\' & $sPC[$i] & '\C$\Program Files\Trend Micro\OfficeScan Client\Ntrtscan.exe', "FileVersion") ; check programfiles for the file version If @error Then ; first one not found $sVersion2 = FileGetVersion('\\' & $sPC[$i] & '\C$\Program Files (x86)\Trend Micro\OfficeScan Client\Ntrtscan.exe', "FileVersion") ; Check programfiles (x86) for the file If @error Then ; still not found _ArrayAdd($Array, $sPC[$i] & "," & "Offline or No Trend") ; add to the array that it doesn't exist in either location ContinueLoop EndIf EndIf _ArrayAdd($Array, $sPC[$i] & "," & $sVersion & " : " & $sVersion2) ; add the version information for the found version Next NOTE: I have edited the original script. The original script wouldn't have written the correct version number into the array if it had been found in the first test, and would have errored due to the variable $sVersion 2 being declared inside the second If conditional check. This declares that variable before the first test, and shouldn't have the problem.
    1 point
  9. #Include <GUIConstantsEx.au3> #Include <GUIEdit.au3> #Include <WindowsConstants.au3> GUICreate('MyGUI', 400, 90) $Input1 = GUICtrlCreateInput('My Text 1', 20, 20, 360, 20) $Input2 = GUICtrlCreateInput('My Text 2', 20, 50, 360, 20) GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND') GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $ID = BitAND($wParam, 0xFFFF) Switch $ID Case $Input1, $Input2 ; etc Switch BitShift($wParam, 16) Case $EN_SETFOCUS GUICtrlSetState($ID, $GUI_FOCUS) _GUICtrlEdit_SetSel($lParam, 0, -1) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND
    1 point
  10. #include <array.au3> $file = @DesktopDir & '\test.ini' _IniSort($file) Func _IniSort($hIni, $iAscend = 1) Local $aIRSN = IniReadSectionNames($hIni) If Not IsArray($aIRSN) Then Return SetError(1, 0, 0) _ArraySort($aIRSN, 0, $iAscend) Local $sHold For $iCC = 1 To UBound($aIRSN) - 1 Local $aIRS = IniReadSection($hIni, $aIRSN[$iCC]) If Not IsArray($aIRS) Then ContinueLoop _ArraySort($aIRS, 0, $iAscend, 0, 2) $sHold &= '[' & $aIRSN[$iCC] & ']' & @CRLF For $xCC = 1 To $aIRS[0][0] $sHold &= $aIRS[$xCC][0] & '=' & $aIRS[$xCC][1] & @CRLF Next Next If $sHold Then $sHold = StringTrimRight($sHold, 2) FileClose(FileOpen($hIni, 2)) FileWrite($hIni, $sHold) Return 1 EndIf Return SetError(1, 0, 0) EndFunc
    1 point
×
×
  • Create New...