Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/25/2018 in all areas

  1. That could be a problem if the multi_sz may contain comma(s). Choose another separator character that you should never encounter, like ChrW(0xFFFD) (Not a Character). And yes those multi_sz are painful and don't even accomodate empty strings if not the first and only one.
    2 points
  2. I can imagine that it wouldn't work with that line. Try this $SelectFile = _GUICtrlListView_GetItemText($ListV1, $s)
    1 point
  3. @TheXman Nice! Its pretty much the same idea as above but cleaner since its already made I Included the code from WinAPIMisc.au3 (Autoit 3.3.14) here Yashied uses _WinAPI_StrLen to walk the string to the next NULL which I imagine is a bit faster Here it is functionally equivalent #include <WinAPIFiles.au3> #Include <Array.au3> Global $sMountedPath = "c:\" ; Don't forget to end with final '\' Global $sGuid = _WinAPI_GetVolumeNameForVolumeMountPoint($sMountedPath) ConsoleWrite("Vol Guid: " & $sGuid & @CRLF) _ArrayDisplay(__WinAPI_GetVolumePathNamesForVolumeName($sGuid), "Mount Point(s):") Func __WinAPI_GetVolumePathNamesForVolumeName($sVolumeGUID) Local $tVolNames, $tSize = DllStructCreate('int iSize') ;First call to get size of buffer req'd Local $aRet = DllCall('kernel32.dll', 'bool', 'GetVolumePathNamesForVolumeNameW', _ 'wstr', $sVolumeGUID, 'ptr', 0, _ 'dword', 0, _ 'ptr', DllStructGetPtr($tSize) _ ) $tVolNames = DllStructCreate("wchar [" & DllStructGetData($tSize, 1) & "]") ;Second call gets the actual data $aRet = DllCall('kernel32.dll', 'bool', 'GetVolumePathNamesForVolumeNameW', _ 'wstr', $sVolumeGUID, _ 'ptr', DllStructGetPtr($tVolNames), _ 'dword', DllStructGetSize($tVolNames), _ 'ptr', DllStructGetPtr($tSize) _ ) If @error Or Not $aRet[0] Then Return SetError(@error + 10, @extended, '') ;Step through the data turn the nulls into invalid unicode char (0xFFFD) @jchd For $i = 1 To (DllStructGetSize($tVolNames)/2) - 2 ;each character occupies (/2) two bytes and we ignore the last (-2) two nulls.. If DllStructGetData($tVolNames, 1, $i) = CHRW(0x0000) Then DllStructSetData($tVolNames, 1, CHRW(0xFFFD), $i) Next Return StringSplit(DllStructGetData($tVolNames, 1), CHRW(0xFFFD)) EndFunc ;==>__WinAPI_GetVolumePathNamesForVolumeName
    1 point
  4. _WinAPI_StructToArray will do the heavy lifting of parsing arrays of null terminated unicode strings. Slightly modified version of the previous solution. #include <WinAPIFiles.au3> #include <Array.au3> Global $sMountedPath = "c:\" Global $sGuid = _WinAPI_GetVolumeNameForVolumeMountPoint($sMountedPath) ConsoleWrite("Vol Guid: " & $sGuid & @CRLF) _ArrayDisplay(__WinAPI_GetVolumePathNamesForVolumeName($sGuid)) Func __WinAPI_GetVolumePathNamesForVolumeName($sVolumeGUID) Local $tVolNames, $tSize = DllStructCreate("int iSize") Local $aPathNames ;First call to get size of buffer req"d Local $aRet = DllCall("kernel32.dll", "bool", "GetVolumePathNamesForVolumeNameW", _ "wstr", $sVolumeGUID, _ "ptr", 0, _ "dword", 0, _ "ptr", DllStructGetPtr($tSize) _ ) $tVolNames = DllStructCreate("byte [" & DllStructGetData($tSize, 1) * 2 & "]") ;Multiply by 2 since TChars are 2 bytes each as far as Autoit is concerned ;Second call gets the actual data $aRet = DllCall("kernel32.dll", "bool", "GetVolumePathNamesForVolumeNameW", _ "wstr", $sVolumeGUID, _ "ptr", DllStructGetPtr($tVolNames), _ "dword", DllStructGetSize($tVolNames), _ "ptr", DllStructGetPtr($tSize) _ ) If @error Or Not $aRet[0] Then Return SetError(@error + 10, @extended, "") Return _WinAPI_StructToArray($tVolNames) EndFunc ;==>__WinAPI_GetVolumePathNamesForVolumeName
    1 point
  5. On a 64 bit machine 32 bit Registry = HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node 64 bit Registry = HKEY_LOCAL_MACHINE\SOFTWARE Assuming your script is compiled as 32 bit, when you used RegWrite to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Holographic" you actually wrote to the 32 bit path i.e.: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Holographic If you compile your script as 64 bit then it would go to the correct location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Holographic However if you want to write to the 64 bit path when your script is compiled as 32 bit, then you can use HKLM64 for 64 bit and HKLM for 32 bit. Personally I prefer using 32 bit compiled scripts otherwise you have to create two separate executables one for 64 bit and one for 32 bit, by using a 32 bit compiled script you can check to see which architecture for example: If @OSArch = "x64" Then RegWrite("HKLM64\...) Else RegWrite("HKLM\...) EndIf Hope that makes sense.
    1 point
  6. ivannikolaisson, Welcome to the AutoIt forums. How often does the "Done" flash? I suggest using a loop adjusting your timing so that you stand a good chance of not always hitting the moment when it is visible and then incrementing a counter to get 3 consecutive hits each at least 500ms apart. M23
    1 point
  7. That's just a technical detail. You can as well walk the string as Word or Uint32 or Short (pick your favorite name) and check for 0x0000 then replace by 0xFFFD (or some other good, highly unlikely choice. Leave the last USHORT as 0x0000 since it will be a good end of string marker. Having the struct element union-ed as Byte[] is good to retrieve it finally as a whole, but going back to the struct element as returned (WChar) allows to grab it as AutoIt string and avoid binary to string as well.
    1 point
  8. Small update available here Fix missed #Include <WinAPISysWin.au3>
    1 point
  9. Try this (not tested): _GDIPlus_Startup() Local $Lf_BitmapHdl = _GDIPlus_BitmapCreateFromMemory( $arg_BinaryImage, True ) ;2nd parameter converts the image to GDI $Lf_SizeTag = _WinAPI_GetBitmapDimension( $Lf_BitmapHdl ) Local $Lf_CurPicWidth = DllStructGetData( $Lf_SizeTag, 'X' ) Local $Lf_CurPicHeight = DllStructGetData( $Lf_SizeTag, 'Y' ) Local $Lf_PosAra = ControlGetPos( "", "", $arg_ControlID ) Local $Lf_CtlPicWidth = $Lf_PosAra[2] Local $Lf_CtlPicHeight = $Lf_PosAra[3] If $Lf_CtlPicWidth <> $Lf_CurPicWidth Then $Lf_MustResize = True If $Lf_CtlPicHeight <> $Lf_CurPicHeight Then $Lf_MustResize = True If $Lf_MustResize Then Local $Lf_BitmapHdl2 = _GDIPlus_BitmapCreateFromMemory( $arg_BinaryImage ) ;load the binary image again but as GDIPlus Local $Lf_ResizedBitmapHdl = _GDIPlus_ImageResize( $Lf_BitmapHdl2, $Lf_CtlPicWidth, $Lf_CtlPicHeight ) ;needs GDIPlus bitmap handle Local $Lf_ResizedBitmapHdl2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($Lf_ResizedBitmapHdl) ;convert image to GDI format _WinAPI_DeleteObject( GUICtrlSendMsg( $arg_ControlID, $STM_SETIMAGE, $IMAGE_BITMAP, $Lf_ResizedBitmapHdl2 ) ) ;here we need a GDI handle _GDIPlus_ImageDispose($Lf_ResizedBitmapHdl) _GDIPlus_ImageDispose($Lf_BitmapHdl2) _WinAPI_DeleteObject($Lf_ResizedBitmapHdl2) EndIf _WinAPI_DeleteObject( GUICtrlSendMsg( $arg_ControlID, $STM_SETIMAGE, $IMAGE_BITMAP, $Lf_BitmapHdl ) ) _WinAPI_DeleteObject($Lf_BitmapHdl) _GDIPlus_Shutdown() Afaik, _GDIPlus_ImageLoadFromStream() function is to stream an image to a different format such as JPG, PNG, etc. An example can be found here to stream image to JPG format:
    1 point
  10. Sounds good @jchd Also I noticed an error while testing it ;$tChar = DllStructCreate("ushort", DllStructGetPtr($tVolNames) + $i) ;should be $tChar = DllStructCreate("ushort", DllStructGetPtr($tVolNames) + $i - 1) since the current pointer + 1 would be the second byte instead of the first byte as intended
    1 point
  11. Depending on the use of strings and their semantics, all those characters may occur. The Unicode "invalid character" is essentially guaranteed to be never encountered.
    1 point
  12. R_P

    Button in StatusBar

    works this #include <GuiStatusBar.au3> #include <GUIConstants.au3> #include <WinAPISysWin.au3> $hGUI = GUICreate("test click statusbar", 500, 200) $g_hStatus = _GUICtrlStatusBar_Create($hGUI) Dim $aParts[3] = [75, 150, -1] _GUICtrlStatusBar_SetParts($g_hStatus, $aParts) $cBtnStatusBar = GUICtrlCreateButton('OK', 0, 0) $_hndl = GUICtrlGetHandle($cBtnStatusBar) $cBtnDummy = GUICtrlCreateDummy() _GUICtrlStatusBar_EmbedControl($g_hStatus, 1, $_hndl, 4) $wProcNew = DllCallbackRegister("_StatusBarWindowProc", "int", "hwnd;uint;wparam;lparam") $wProcOld = _WinAPI_SetWindowLong($g_hStatus, $GWL_WNDPROC, DllCallbackGetPtr($wProcNew)) GUISetState(@SW_SHOW) While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $GUI_EVENT_CLOSE ExitLoop Case $idMsg = $cBtnDummy ConsoleWrite('StatusBar OK click' & @CRLF) EndSelect WEnd Func _StatusBarWindowProc($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam, $lParam Local $nNotifyCode = BitShift($wParam, 16) Local $nID = BitAND($wParam, 0x0000FFFF) Switch $Msg Case $WM_COMMAND Switch $lParam Case $_hndl Switch $nNotifyCode Case $BN_CLICKED GUICtrlSendToDummy($cBtnDummy) EndSwitch EndSwitch Case $WM_NCPAINT _GUICtrlStatusBar_EmbedControl($g_hStatus, 1, $_hndl) EndSwitch Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $Msg, $wParam, $lParam) EndFunc
    1 point
  13. Those single null separated double null terminated strings have always been a pain #include <WinAPIFiles.au3> Global $sMountedPath = "c:\" ; Don't forget to end with final '\' Global $sGuid = _WinAPI_GetVolumeNameForVolumeMountPoint($sMountedPath) ConsoleWrite("Vol Guid: " & $sGuid & @CRLF) ConsoleWrite("Mount Point(s): " & __WinAPI_GetVolumePathNamesForVolumeName($sGuid) & @CRLF) Func __WinAPI_GetVolumePathNamesForVolumeName($sVolumeGUID) Local $tVolNames, $tSize = DllStructCreate('int iSize') ;First call to get size of buffer req'd Local $aRet = DllCall('kernel32.dll', 'bool', 'GetVolumePathNamesForVolumeNameW', 'wstr', $sVolumeGUID, 'ptr', 0, 'dword', 0, 'ptr', DllStructGetPtr($tSize)) $tVolNames = DllStructCreate("wchar [" & DllStructGetData($tSize, 1) & "]") ;Second call gets the actual data $aRet = DllCall('kernel32.dll', 'bool', 'GetVolumePathNamesForVolumeNameW', 'wstr', $sVolumeGUID, _ 'ptr', DllStructGetPtr($tVolNames), 'dword', DllStructGetSize($tVolNames), 'ptr', DllStructGetPtr($tSize)) If @error Or Not $aRet[0] Then Return SetError(@error + 10, @extended, '') ;Step through the data turn the nulls into invalid unicode char (0xFFFD) @jchd For $i = 1 To (DllStructGetSize($tVolNames)/2) - 2 ;each character occupies 2 bytes and we ignore the last two characters If DllStructGetData($tVolNames, 1, $i) = CHRW(0x0000) Then DllStructSetData($tVolNames, 1, CHRW(0xFFFD), $i) Next Return DllStructGetData($tVolNames, 1) EndFunc ;==>__WinAPI_GetVolumePathNamesForVolumeName There are probably other ways to do this but its what I came up with off the top of my head see here: https://docs.microsoft.com/en-us/windows-server/storage/disk-management/assign-a-mount-point-folder-path-to-a-drive it'll show you how to add multiple mount point folders to a drive so you can test it
    1 point
  14. It looks like that fixed it XMan!! (I.e., adding 'False' to the close command for $oReadBook). Going to do some more testing with a larger set of files but looking good in small-scale testing. Thanks again!
    1 point
  15. One more thing you can try is changing: _Excel_BookClose($oReadBook) To _Excel_BookClose($oReadBook, False) Since $oReadBook is just being read, there no need to save it when closing it. Whatever is causing the extra files and folder, it is probably happening when you save the file. The only files that you are saving over and over is the $oReadBook due to the default for _Excel_BookClose being to save the file. It's worth a shot.
    1 point
  16. AdamUL

    Set Acl permissions UDF

    @YawStar I changed the data types in the dll call, and was able to get some test scripts to work without issue. I have attached the updated UDF. Please test to see if it works for you. Permissions-Unicode.au3 Adam
    1 point
  17. Jos

    AutoIT3.exe stops with Rc 259

    Funny to see how this thread took quite some turns in conclusions. Likely this is an returncode generated due to some process not terminating in the defined period and causing this returncode Jos
    1 point
  18. Try something like: #include <Excel.au3> Local $sSourcePath = "C:\Users\JPSITI\Desktop\Autoit" If FileExists($sSourcePath) = 0 Then DirCreate($sSourcePath) Local $sTargetPath = "C:\Users\JPSITI\Desktop\Autoit" If FileExists($sTargetPath) = 0 Then DirCreate($sTargetPath) Local $sSourceBook = @ScriptDir & "\Test Scope.xlsx" ;$sSourcePath & "\Test Scope.xlsx" Local $oExcel = _Excel_Open() If @error Then Exit MsgBox(4096, "Excel Error", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oSourceBook = _Excel_BookOpen($oExcel, $sSourceBook) If @error Then MsgBox(4096, "Excel Error", "Error opening workbook '" & $sSourceBook & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf Local $oSourceRange, $oTargetBook, $sTargetBook, $x = 1 For $i = 4 To 10 $oSourceRange = _Excel_RangeRead($oSourceBook,"Test Scope","D" & $i) $sTargetBook = $sTargetPath & "\" & $x & ".xlsx" $oTargetBook = _Excel_BookOpen($oExcel, $sTargetBook) If @error Then $oTargetBook = _Excel_BookNew($oExcel) _Excel_RangeWrite($oTargetBook, Default, $oSourceRange, "C" & $i) _Excel_BookSaveAs($oTargetBook, $sTargetBook, $xlWorkbookDefault) _Excel_BookClose($oTargetBook) $x += 1 Next
    1 point
  19. A graphic handle is something like a canvas whereas a bitmap is like a picture which you are putting on the canvas. A graphic handle is a device only whereas a bitmap is a structe which held the information in the memory. #include <GDIPlus.au3> #include <String.au3> _GDIPlus_Startup() Global Const $aNibbles[16][2] = [ _ ["0000", "0"], _ ["0001", "1"], _ ["0010", "2"], _ ["0011", "3"], _ ["0100", "4"], _ ["0101", "5"], _ ["0110", "6"], _ ["0111", "7"], _ ["1000", "8"], _ ["1001", "9"], _ ["1010", "A"], _ ["1011", "B"], _ ["1100", "C"], _ ["1101", "D"], _ ["1110", "E"], _ ["1111", "F"]] ; Global Const $aDOS_color[16] = [ _ 0xFF000000, _ ; 0x0 = 00 = Black 0XFF000080, _ ; 0x1 = 01 = Blue 0XFF008000, _ ; 0x2 = 02 = Green 0XFF008080, _ ; 0x3 = 03 = Aqua 0XFF800000, _ ; 0x4 = 04 = Red 0XFF800080, _ ; 0x5 = 05 = Purple 0XFF808000, _ ; 0x6 = 06 = Yellow 0XFFC0C0C0, _ ; 0x7 = 07 = White 0XFF808080, _ ; 0x8 = 08 = Gray 0XFF0000FF, _ ; 0x9 = 09 = Light Blue 0XFF00FF00, _ ; 0xA = 10 = Light Green 0XFF00FFFF, _ ; 0xB = 11 = Light Aqua 0XFFFF0000, _ ; 0xC = 12 = Light Red 0XFFFF00FF, _ ; 0xD = 13 = Light Purple 0XFFFFFF00, _ ; 0xE = 14 = Light Yellow 0xFFFFFFFF]; ; 0xF = 15 = Bright White ; Global $iPixSide = 1, _ ; side of char's pixels $iVtab = 0, _ ; Vertical position of cursor $iHtab = 0, _ ; Horizontal position of cursor $iBG_DefaultColor = 0, _ ; Default Background color 0 = Black $iFG_DefaultColor = 10, _ ; Default Foreground color 7 = White $ahColors[2] = [ _ ; Array of brush handles _GDIPlus_BrushCreateSolid($aDOS_color[$iBG_DefaultColor]), _ ; default background for chars (Format AARRGGBB) _GDIPlus_BrushCreateSolid($aDOS_color[$iFG_DefaultColor])], _ ; default foreground for chars. $iWidth, _ ; Width in bit of char $iHeight ; height in bit of char HotKeySet("{ESC}", "_Terminate") ; ------------------ Local $iWinWidth = 500 Local $iWinHeight = 400 Local $hScreen = GUICreate("", $iWinWidth, $iWinHeight, 10, 10) GUISetState(@SW_SHOW, $hScreen) Local $hCanvas = _GDIPlus_GraphicsCreateFromHWND($hScreen) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWinWidth, $iWinHeight) Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, 2) Local $aFont, $tGraphic While 1 $aFont = _LoadFont() If IsArray($aFont) Then For $i = 0 To UBound($aFont) - 1 ; just for test, it prints all chars contained in the font _CharGen($hCanvas, $aFont[$i]); print a bitmapped char on the graphic object ; update cursor position $tGraphic = DllStructCreate("long width;long height", $hCanvas + 24) ; thanks to Danyfirex! $iHtab += ($iWidth * $iPixSide) If $iHtab > $tGraphic.width - ($iWidth * $iPixSide) Then $iVtab += ($iHeight * $iPixSide) $iHtab = 0 If $iVtab > $tGraphic.height - ($iHeight * $iPixSide) Then $iVtab = 0 EndIf Next EndIf _CharColor(Random(1, 15, 1)) ; random foreground color WEnd _Terminate() Func _CharGen($hCanvas, $vBits, $iBase = 8) If IsArray($vBits) Then ; if argument is an array then third parameter is ignored since it can be inferred from array dim and array content itself For $iRow = UBound($vBits) - 1 To 0 Step -1 ; UBound of array is the number of rows For $iBit = StringLen($vBits[$iRow]) To 1 Step -1;StringLen of array's content is the number of horizontal pixels _GDIPlus_GraphicsFillRect($hCtxt, _ ; it draws a single pixel at a time $iHtab + $iPixSide * $iBit, _ ; Horizontal pixel position within the matrix $iVtab + $iPixSide * $iRow, _ ; Vertical pixel position within the matrix $iPixSide, $iPixSide, _ ; pixel is a square $ahColors[StringMid($vBits[$iRow], $iBit, 1)]) ; bit 0 = background; bit 1 = foreground Next ; next horizontal pixel Next ; next row Else For $iBit = StringLen($vBits) - 1 To 0 Step -1 ; get all bits one by one _GDIPlus_GraphicsFillRect($hCtxt, _ ; it draws a single pixel at a time $iHtab + $iPixSide * Mod($iBit, $iBase), _ ; Horizontal pixel position within the matrix $iVtab + $iPixSide * Int($iBit / $iBase), _ ; Vertical pixel position within the matrix $iPixSide, $iPixSide, _ ; pixel is a square $ahColors[StringMid($vBits, $iBit + 1, 1)]) Next EndIf _GDIPlus_GraphicsDrawImageRect($hCanvas, $hBitmap, 0, 0, $iWinWidth, $iWinHeight) Local Static $iCounter = 0 _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\MatrixFont" & $iCounter & ".jpg") $iCounter += 1 EndFunc ;==>_CharGen ; ------------------------------------------------------------ ; set Background and foreground colors for chars ; for DOS style pass 0x00 to 0xFF as single argument ; for custom colors use 0xAARRGGBB format for both arguments ; for reset to default colors just call func without arguments ; ------------------------------------------------------------ Func _CharColor($vBackGr = "", $vForeGr = "") If $vBackGr == "" And $vForeGr == "" Then ; set default _GDIPlus_BrushSetSolidColor($ahColors[0], $aDOS_color[$iBG_DefaultColor]) ; background _GDIPlus_BrushSetSolidColor($ahColors[1], $aDOS_color[$iFG_DefaultColor]) ; foreground ElseIf $vBackGr < 256 And $vForeGr = "" Then ; set as in DOS (use 0xNN N_=backgroung _N=foreground) $vForeGr = Dec(Hex($vBackGr, 1)) $vBackGr = Dec(StringLeft(String(Hex($vBackGr, 2)), 1)) _GDIPlus_BrushSetSolidColor($ahColors[0], $aDOS_color[$vBackGr]) ; background _GDIPlus_BrushSetSolidColor($ahColors[1], $aDOS_color[$vForeGr]) ; foreground Else ; set custom colors _GDIPlus_BrushSetSolidColor($ahColors[0], $vBackGr) ; background _GDIPlus_BrushSetSolidColor($ahColors[1], $vForeGr) ; foreground EndIf EndFunc ;==>_CharColor Func _LoadFont() ; Display an open dialog to select a list of file(s). Local $sFile = FileOpenDialog("Select a font file?", "", "All (*.c)", $FD_FILEMUSTEXIST) ; ; Read the file.c Local $hFile = FileOpen($sFile) Local $sFont = FileRead($hFile) FileClose($hFile) ; $aBytes = _StringBetween($sFont, "0x", ",") ; extract only binary bytes ; $iWidth = Dec($aBytes[0]) ; Width in bit of each single char $iHeight = Dec($aBytes[1]) ; height Local $iWhatis = Dec($aBytes[2]) ; ? Local $iChars = Dec($aBytes[3]) ; nr of chars in this font Local $iBytesPerChar = ($iWidth * $iHeight) / 8 Local $aFontMatrix[$iChars] Local $aTemp[$iHeight] Local $iNdx0 = 0, $iNdx1 = 0 ; ; Transform Hex bytes to binary digits For $i = 4 To UBound($aBytes) - 1 $aTemp[$iNdx1] &= _TextToBinaryString($aBytes[$i]) If StringLen($aTemp[$iNdx1]) = $iWidth Then $iNdx1 += 1 If $iNdx1 < $iHeight Then $aTemp[$iNdx1] = "" Else $aFontMatrix[$iNdx0] = $aTemp $iNdx0 += 1 $iNdx1 = 0 $aTemp[$iNdx1] = "" EndIf EndIf Next Return $aFontMatrix EndFunc ;==>_LoadFont Func _TextToBinaryString($sHexText) Local $sBits = "" For $i = 1 To StringLen($sHexText) $sBits &= $aNibbles[Dec(StringMid($sHexText, $i, 1))][0] Next Return $sBits EndFunc ;==>_TextToBinaryString Func _Terminate() If WinActive($hScreen) Then ; Clean up resources _GDIPlus_GraphicsDispose($hCanvas) _GDIPlus_BrushDispose($ahColors[0]) _GDIPlus_BrushDispose($ahColors[1]) _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() MsgBox(0, "Debug", "Bye bye", 1) Exit EndIf EndFunc ;==>_Terminate
    1 point
  20. I'm no Regex expert, but doesn't this work? $test = "This is my test text. It is about a hand and a foot. The " & @LF _ & "hand wanted to be a head, " & @LF _ & "and, also, the foot wanted the " & @LF _ & "word 'and' tattooed on it. Theirs was a strange relationship." MsgBox(0, "RegEx Replace Test", StringRegExpReplace($test, "\band\b", "&"))
    1 point
×
×
  • Create New...