Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/09/2022 in all areas

  1. If I understand you correctly, you want to modify the spreadsheet by eliminating all duplicates row (unless merging has another meaning for you ?) Edit : I think I got it. You want to modify the spreadsheet and add second column together for all duplicate rows (in first column).
    1 point
  2. @Danp2 What I'm looking to do is in this link. https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/ie-mode?tabs=python I would like to do this in webdriver with autoit. You can access pages by emulating Internet Explorer on EDGE, without using IE.
    1 point
  3. Yeah.. what can I say after 15 years.
    1 point
  4. Deye

    File Settings

    Funnily windows 10 is not a finished product and still people will expect things to work as if it was "windows xp" , maybe this will be fixed in windows 11
    1 point
  5. I had seen this Headless mode, but actually I hadn't understood that it corresponded to a hidden mode. I was rather thinking that it would display a web page without the address bar and without any menu. Anyway I have my answer, thank you.
    1 point
  6. stupid me... I was running the program in a separate folder as I remember your previous version was not running if folder name had 'spaces', so I was copying in a temp folder, but was missing some other important files the program summons... Disregard my previous message. It works flawlessly!!! Thank you so much!!
    1 point
  7. For fun, a case sensitive search example #include <Array.au3> $file = "InstallSoftware.txt" _Read($file, 'Acrobat') _Read($file, 'Silverlight') _Read($file, 'Kaspersky') _Read($file, 'AnyConnect') _Read($file, 'Microsoft Visual C') Func _Read($file, $sString) $a = StringSplit(StringRegExpReplace(StringRegExp(FileRead($file), "(?i)[\w ]+\Q" & $sString & "\E.*", 1)[0], '\s{3,}', "|"), "|", 2) $a[0] = StringRegExpReplace($a[0], "(\d{4})(\d{2})(\d{2})(.*)", "$1/$2/$3") _ArrayDisplay($a, $sString) EndFunc
    1 point
  8. Hello, I want the browser work without ever showing it. With the old function _IECreate it was enough to set the $iVisible parameter to 0. Is there something equivalent with webdriver ? I'm not talking about the console but about the browser. I think it would be possible to do something with WinSetState, but I prefer if the browser never appear. If this function does not exist, I still thank you for your work
    1 point
  9. wakillon

    Water Effects

    Browsing a Chinese AutoIt forum, i fall on a little pearl that i want to share with you ! I have already seen water effects example with autoit, but this one is very easy to create using waterctrl.dll Only BMP are supported. Position of Blob water can be set by coordinates and mouse movements (and clicks) when over bmp create traces on water. All files are embeded in script with BinaryToAu3Kompressor. WaterEffect.au3 Hope you like it !
    1 point
  10. Today, in the end as well, worked out using the Acrobat Reader ActiveX COM Object "AcroPDF.PDF.1" #include-once #include <Constants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Misc.au3> #include <MenuConstants.au3> #include <WinAPI.au3> ;~ Thanks to BrewManNH ;~ http://www.autoitscript.com/forum/topic/134878-guiregistermsg-replacement-for-guictrlsetonevent-and-guigetmsg/ ;~ Thanks to mikell ;~ http://www.autoitscript.com/forum/topic/161985-how-to-close-gui-with-guiregistermsg/ ; Install a custom error handler Global $oMyError = ObjEvent("AutoIt.Error", "_ComErrFunc") Global $__hExampleGUI Global $__idOPEN Global $_fExit Global $__hACROBAT_GUI = '' Global $__idACROBAT_GUI_CTRL_AX = '' Global $__oACROBAT_READER = '' #include <GUIConstantsEx.au3> ;~ GUIRegisterMsg($WM_ERASEBKGND, "_WM_EXTRACTOR") ;~ GUIRegisterMsg($WM_PAINT, "_WM_EXTRACTOR") ;~ GUIRegisterMsg($WM_ACTIVATE, "_WM_EXTRACTOR") ;~ GUIRegisterMsg($WM_CAPTURECHANGED, "_WM_EXTRACTOR") ;~ GUIRegisterMsg($WM_DEVICECHANGE, "_WM_EXTRACTOR") GUIRegisterMsg($WM_EXITSIZEMOVE, "_WM_EXTRACTOR") GUIRegisterMsg($WM_COMMAND, "_WM_EXTRACTOR") GUIRegisterMsg($WM_SYSCOMMAND, "_WM_EXTRACTOR") GUIRegisterMsg($WM_HSCROLL, "_WM_EXTRACTOR") _ExampleProgram_Gui() While 1 Sleep(10) If $_fExit Then _ACROBAT_GUI_DELETE() DeleteGui() Exit EndIf WEnd Func DeleteGui() GUIDelete($__hExampleGUI) EndFunc ;==>DeleteGui Func _ExampleProgram_Gui() ; Create a GUI with various controls. $__hExampleGUI = GUICreate("Example") $__idOPEN = GUICtrlCreateButton("&Open", 310, 370, 85, 25) ; Display the GUI. GUISetState(@SW_SHOW, $__hExampleGUI) EndFunc ;==>_ExampleProgram_Gui #Region ACROBAT FUNCTION Func _AcrobatInit() $__oACROBAT_READER = ObjCreate("AcroPDF.PDF.1"); Return $__oACROBAT_READER.GetVersions EndFunc ;==>_AcrobatInit Func _Acrobat_Events(ByRef $aMSG) If $aMSG[1] = $__hACROBAT_GUI Then Switch $aMSG[0] Case $GUI_EVENT_CLOSE _ACROBAT_GUI_DELETE() EndSwitch EndIf EndFunc ;==>_Acrobat_Events Func _ACROBAT_Destroy() $__oACROBAT_READER = "" ;~ MsgBox(1,'test','destroyed') EndFunc ;==>_ACROBAT_Destroy Func _AcrobatShow($sFile, $sTitle = "PDF ", $iLeft = 50, $iTop = 0, $iWidth = 1000, $iHeight = 700) If FileExists($sFile) Then _AcrobatInit() ; Set option $__oACROBAT_READER.src = $sFile $__oACROBAT_READER.SetLayoutMode(4) $__oACROBAT_READER.SetPageMode(1) $__oACROBAT_READER.SetShowToolbar(0) $__oACROBAT_READER.SetView(1) ; Create GUI $__hACROBAT_GUI = GUICreate($sTitle, $iWidth, $iHeight, $iLeft, $iTop, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX)) $__idACROBAT_GUI_CTRL_AX = GUICtrlCreateObj($__oACROBAT_READER, 5, 5, $iWidth - 20, $iHeight - 10) GUICtrlSetStyle($__idACROBAT_GUI_CTRL_AX, $WS_VISIBLE) GUISetState() EndIf EndFunc ;==>_AcrobatShow Func _ACROBAT_Refresh() If IsObj($__oACROBAT_READER) Then Local $hPreviouslyGui = GUISwitch($__hACROBAT_GUI) GUISetState(@SW_LOCK) Local $iGUI_PDFWidth = WinGetPos($__hACROBAT_GUI)[2] - 20 Local $iGUI_PDFHeight = WinGetPos($__hACROBAT_GUI)[3] - 40 Local $sFile = $__oACROBAT_READER.src ; this below line do not works with Acro Reader ; Local $iCurrentPage = $__oACROBAT_READER.GetNumber Local $iCurrentPage = 0 _ACROBAT_Destroy() GUICtrlDelete($__idACROBAT_GUI_CTRL_AX) _AcrobatInit() $__idACROBAT_GUI_CTRL_AX = GUICtrlCreateObj($__oACROBAT_READER, 5, 5, $iGUI_PDFWidth, $iGUI_PDFHeight) $__oACROBAT_READER.src = $sFile ;~ $__oACROBAT_READER.SetCurrentPage($iCurrentPage) GUISetState(@SW_UNLOCK) GUISwitch($hPreviouslyGui) EndIf EndFunc ;==>_ACROBAT_Refresh Func _ACROBAT_GUI_DELETE() _ACROBAT_Destroy() if IsHWnd($__hACROBAT_GUI) then GUIDelete($__hACROBAT_GUI) EndFunc ;==>_ACROBAT_GUI_DELETE #EndRegion ACROBAT FUNCTION #Region MSG and ERROR HANDLER Func _WM_EXTRACTOR($hWnd, $iMsg, $wParam, $lParam) ;~ ConsoleWrite('! $hWnd = ' & $hWnd & ' $iMsg = ' & $iMsg & '('&HEX($iMsg)&')'& ' $wParam = ' & $wParam & ' $lParam = ' & $lParam & @CRLF) If $hWnd = ControlGetHandle($__hACROBAT_GUI, '', $__idACROBAT_GUI_CTRL_AX) Then ConsoleWrite('! -------------- $hWnd = ' & $hWnd & ' $iMsg = ' & $iMsg & '(' & Hex($iMsg) & ')' & ' $wParam = ' & $wParam & ' $lParam = ' & $lParam & @CRLF) EndIf If $hWnd = $__hACROBAT_GUI Then Switch $iMsg Case $WM_COMMAND #cs Case $WM_ACTIVATE Local $test = BitAND($wParam, 0x00000004) if $test <> 0 then MsgBox(1,'$WM_ACTIVATE','test') _ACROBAT_Refresh() EndIf Case $WM_ERASEBKGND WinGetHandle("[ACTIVE]") if $__hACROBAT_GUI <> _WinAPI_GetWindow ( $__hACROBAT_GUI, $GW_HWNDPREV ) then ConsoleWrite('! Case $WM_ERASEBKGND' & @CRLF) _ACROBAT_Refresh() _WinAPI_RedrawWindow($__hACROBAT_GUI,0,0,$RDW_NOERASE) EndIf Case $WM_PAINT _WinAPI_RedrawWindow($__hACROBAT_GUI,0,0,$RDW_NOERASE) Case $WM_CAPTURECHANGED _ACROBAT_Refresh() Case $WM_DEVICECHANGE _ACROBAT_Refresh() #ce Case $WM_EXITSIZEMOVE _ACROBAT_Refresh() Case $WM_SYSCOMMAND ;~ Local $test = BitAND($wParam, 0xFFF0) Local $test = BitAND($wParam, 0x0000FFFF) Switch $test Case $SC_CLOSE _ACROBAT_GUI_DELETE() Case $SC_CONTEXTHELP Case $SC_DEFAULT Case $SC_HOTKEY Case $SC_HSCROLL Case $SC_KEYMENU Case $SC_MAXIMIZE _ACROBAT_Refresh() Case $SC_MINIMIZE Case $SC_MONITORPOWER Case $SC_MOUSEMENU Case $SC_MOVE ;~ _ACROBAT_Refresh() Case $SC_NEXTWINDOW ;~ _ACROBAT_Refresh() Case $SC_PREVWINDOW ;~ _ACROBAT_Refresh() Case $SC_RESTORE _ACROBAT_Refresh() Case $SC_SCREENSAVE Case $SC_SIZE Case $SC_TASKLIST Case $SC_VSCROLL EndSwitch EndSwitch EndIf If $hWnd = $__hExampleGUI Then Switch $iMsg Case $WM_COMMAND Local $nID = BitAND($wParam, 0x0000FFFF) Local $hCtrl = $lParam Switch $nID Case $__idOPEN if not IsObj($__oACROBAT_READER) then _AcrobatShow(FileOpenDialog("Choose PDF", "C:\Temp", "PDF Files(*.pdf)", 3)) ; put your own start folder here) EndIf EndSwitch Case $WM_SYSCOMMAND Local $test = BitAND($wParam, 0xFFF0) Switch $test Case $SC_CLOSE $_fExit = True Case $SC_CONTEXTHELP Case $SC_DEFAULT Case $SC_HOTKEY Case $SC_HSCROLL Case $SC_KEYMENU Case $SC_MAXIMIZE Case $SC_MINIMIZE Case $SC_MONITORPOWER Case $SC_MOUSEMENU Case $SC_MOVE Case $SC_NEXTWINDOW Case $SC_PREVWINDOW Case $SC_RESTORE Case $SC_SCREENSAVE Case $SC_SIZE Case $SC_TASKLIST Case $SC_VSCROLL EndSwitch EndSwitch EndIf Return $GUI_RUNDEFMSG EndFunc ;==>_WM_EXTRACTOR Func _ComErrFunc() Local $HexNumber = Hex($oMyError.number, 8) MsgBox(0, "AutoItCOM Test", _ "We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) EndFunc ;==>_ComErrFunc #EndRegion MSG and ERROR HANDLER Any comments are welcome. Cheers mLipok
    1 point
  11. Then I can publish it now. Thank you for your effort and patience! 👍
    1 point
  12. I think there is a typo in the code of the last post: Local $hBrush = _SendMessage($hWndMain, $WM_CTLCOLORSTATIC, $hdc, $hWnd) Local $hBrush = _SendMessage($hWnd_Main, $WM_CTLCOLORSTATIC, $hdc, $hWnd) Thanks for sharing the code!
    1 point
  13. BinaryToAu3Kompressor v1.0.5.4 It's now possible to see the best compression ratio using LZMA, LZNT and Base64 compressions with differents combinations. Nothing too complicate, you drag'n drop a file on the picture and script Test all compression types and return the ratios. ( Test duration depends of file size, slowest compression is LZNT, but all decompressions are fast ) Free to you after, to choose the compression(s) you want... Yes, LZMA needs a dll ( embedded & compressed in script ) but brings a powerfull compression. It opens scite with your file compressed to an au3 script with or without decompression function as you want. Hold Left Shift key when clicking button for just copy script to clipboard. Use the 3 compressions at a time works but doesn't give a good ratio, that's why i don't display it. Usefull for little files you want include in your scripts ! No externals files needed, they are already in script. Previous downloads : 1103 Source and Executable BinaryToAu3Kompressor will be added to the next version of >SciTEHopper Thanks to Ward for his >Base64.au3 and LZMA.au3, and trancexx for his >LZNT functions and his >Base64Decode function.
    1 point
  14. bladem2003

    xVideo 1.2.2 UDFv0.1

    Hello Here is the UDF for xVIDEO.dll 1.2.2 Autoit 3.3.8.0 xVideo is a Directshow wrapper that will help it’s users create multimedia aplications.It’s compatible with any language that supports STDCALL calling convention. Features -Any media playback(require necessary codec installed) -Plays multiple videos at once -Extract audio -Streaming file from internet -Plugins Support (Decoders, DSP and others) -Text Overlay Support -VMR,VMR9,EVR support,VMR7/9 WindowsLess Mode -Image overlay support -Audio Pitch, Tempo, Channel Process -Color Controls(brightness,hue,saturation,contrast) -Mixing Videos Support -DVD playback -Multiple Video Output -Support for capture devices -Convert media files support -Users audio DSP’s -Build in audio Equalizer,Reverb,Echo,Compressor,Flanger -Play media files from Memory/User file system -Winamp DSP plugin Support(via addon) -Real time audio level -waveform draw Download : http://surodev.com _xVideo.au3 _xVideoUDFv0.1.au3 xVideo.dll
    1 point
  15. Faster way to convert multiple dosdevice paths to file paths \Device\HarddiskVolume1\Program Files\ test1.exe =>C:\Program Files\ test1.exe Test 1 caches the drive letter and dosdevicename of every drive in a single string it then uses regexp to find the dosdevice and replace it with the drive letter, only re-caching when string isn't found Test 2 calls DriveGetDrive and _WinAPI_QueryDosDevice everytime and uses simple stringreplace Test 3 caches DriveGetDrive and _WinAPI_QueryDosDevice to an array and uses simple stringreplace, only re-cache when string isn't found #include <WinAPIFiles.au3> Local $DosDevicePath = _WinAPI_QueryDosDevice("c:") ConsoleWrite("C: = " & $DosDevicePath & @CRLF & @CRLF) ;Test1-------------------------------------------------------------------------------------- ConsoleWrite($DosDevicePath & "\Program Files\Test\myprogram\test1.exe" & " => ") Local $hTimer = TimerInit() Local $sDosDevMap = EnumDosDeviceMapString() ;ConsoleWrite("Lookup Strings: " & $sDosDevMap & @CRLF) For $x = 0 To 200 GetFilePathFromDosDevicePath("" & $DosDevicePath & "\Program Files\Test\myprogram\test1.exe", $sDosDevMap) Next For $x = 0 To 200 GetFilePathFromDosDevicePath("yu" & $DosDevicePath & "yu\Program Files\Test\myprogram\test1.exe", $sDosDevMap) Next For $x = 0 To 200 GetFilePathFromDosDevicePath($DosDevicePath & "yu\Program Files\Test\myprogram\test1.exe", $sDosDevMap) Next ConsoleWrite(TimerDiff($hTimer) & " MS" & @CRLF) ConsoleWrite(GetFilePathFromDosDevicePath($DosDevicePath & "\Program Files\Test\myprogram\test1.exe", $sDosDevMap) & " @error = " & @error & @CRLF) ConsoleWrite($DosDevicePath & "yu\Program Files\Test\myprogram\test1.exe" & " => ") ConsoleWrite(GetFilePathFromDosDevicePath($DosDevicePath & "yu\Program Files\Test\myprogram\test1.exe", $sDosDevMap) & " @error = " & @error & @CRLF) ConsoleWrite("yu" & $DosDevicePath & "yu\Program Files\Test\myprogram\test1.exe" & " => ") ConsoleWrite(GetFilePathFromDosDevicePath("yu" & $DosDevicePath & "yu\Program Files\Test\myprogram\test1.exe", $sDosDevMap) & " @error = " & @error & @CRLF & @CRLF) ;Test2-------------------------------------------------------------------------------------- ConsoleWrite($DosDevicePath & "\Program Files\Test\myprogram\test2.exe" & " => ") Local $hTimer = TimerInit() For $x = 0 To 200 _DosPathNameToPathName("" & $DosDevicePath & "\Program Files\Test\myprogram\test2.exe") Next For $x = 0 To 200 _DosPathNameToPathName("yu" & $DosDevicePath & "yu\Program Files\Test\myprogram\test2.exe") Next For $x = 0 To 200 _DosPathNameToPathName($DosDevicePath & "yu\Program Files\Test\myprogram\test2.exe") Next ConsoleWrite(TimerDiff($hTimer) & " MS" & @CRLF) ConsoleWrite(_DosPathNameToPathName($DosDevicePath & "\Program Files\Test\myprogram\test2.exe") & " @error = " & @error & @CRLF) ConsoleWrite($DosDevicePath & "yu\Program Files\Test\myprogram\test2.exe" & " => ") ConsoleWrite(_DosPathNameToPathName($DosDevicePath & "yu\Program Files\Test\myprogram\test2.exe") & " @error = " & @error & @CRLF) ConsoleWrite("yu" & $DosDevicePath & "yu\Program Files\Test\myprogram\test2.exe" & " => ") ConsoleWrite(_DosPathNameToPathName("yu" & $DosDevicePath & "yu\Program Files\Test\myprogram\test2.exe") & " @error = " & @error & @CRLF & @CRLF) ;Test3-------------------------------------------------------------------------------------- ConsoleWrite($DosDevicePath & "\Program Files\Test\myprogram\test3.exe" & " => ") Local $hTimer = TimerInit() Local $aEnumDosDevice = EnumDosDeviceMapStringArr() For $x = 0 To 200 _DosPathNameToPathNameArr("" & $DosDevicePath & "\Program Files\Test\myprogram\test3.exe", $aEnumDosDevice) ;_DosPathNameToPathName("" & $DosDevicePath & "uy\Program Files\Test\myprogram\test.exe") Next For $x = 0 To 200 _DosPathNameToPathNameArr("yu" & $DosDevicePath & "yu\Program Files\Test\myprogram\test3.exe", $aEnumDosDevice) Next For $x = 0 To 200 _DosPathNameToPathName($DosDevicePath & "yu\Program Files\Test\myprogram\test2.exe") Next ConsoleWrite(TimerDiff($hTimer) & " MS" & @CRLF) ConsoleWrite(_DosPathNameToPathNameArr($DosDevicePath & "\Program Files\Test\myprogram\test3.exe", $aEnumDosDevice) & " @error = " & @error & @CRLF) ConsoleWrite($DosDevicePath & "yu\Program Files\Test\myprogram\test3.exe" & " => ") ConsoleWrite(_DosPathNameToPathNameArr($DosDevicePath & "yu\Program Files\Test\myprogram\test3.exe", $aEnumDosDevice) & " @error = " & @error & @CRLF) ConsoleWrite("yu" & $DosDevicePath & "yu\Program Files\Test\myprogram\test3.exe" & " => ") ConsoleWrite(_DosPathNameToPathNameArr("yu" & $DosDevicePath & "yu\Program Files\Test\myprogram\test3.exe", $aEnumDosDevice) & " @error = " & @error & @CRLF & @CRLF) ;Test1-------------------------------------------------------------------------------------- Func EnumDosDeviceMapString() ;Make a list of found drives and their DosDevice Name ;c:=\Device\HarddiskVolume1;d:=\Device\HarddiskVolume2; Local $sResult = "" Local $aDrive = DriveGetDrive('ALL') If IsArray($aDrive) Then For $i = 1 To $aDrive[0] $sResult &= StringUpper($aDrive[$i]) & Chr(127) & _WinAPI_QueryDosDevice($aDrive[$i]) & ";" Next ;ConsoleWrite($sResult & @CRLF) Else ConsoleWrite("Error Enumerating Drives") Return SetError(1, 0, $sResult) EndIf Return SetError(@error, 0, $sResult) EndFunc ;==>EnumDosDeviceMapString Func GetFilePathFromDosDevicePath($DosDevicePath, ByRef $sDosDeviceMap) ;Replace DosDeviceName with Drive Letter:\ in a path ;\Device\HarddiskVolume1\Test => c:\Test Local $sDosTempName = "" Local $aResult = StringRegExp($DosDevicePath & "\\", "(?i)(^\\Device\\.+?)(?=\\)", 1, 1) ;Get only the \Device\HarddiskVolume part of the supplied path If IsArray($aResult) Then $sDosTempName = $aResult[0] For $i = 0 To 1 If $i = 1 Then ElseIf Not (StringInStr($sDosDeviceMap, $sDosTempName)) Then $sDosDeviceMap = EnumDosDeviceMapString() ;Failed try to get new drive mappings ContinueLoop EndIf $aResult = StringRegExp($sDosDeviceMap, "(?i)([\S]:(?=" & Chr(127) & StringReplace($sDosTempName, "\", "\\") & ";))", 1, 1) ;Return Drive Letter :\ If IsArray($aResult) Then Return StringReplace($DosDevicePath, $sDosTempName, $aResult[0]) Else Return SetError(1, 0, $DosDevicePath) EndIf Next EndIf Return SetError(2, 1, $DosDevicePath) EndFunc ;==>GetFilePathFromDosDevicePath ;Test2-------------------------------------------------------------------------------------- Func _DosPathNameToPathName($sPath) ;Yashied: www.autoitscript.com/forum/topic/119174-how-to-get-drive-letter-from-deviceharddiskvolumex/ Local $sName, $aDrive = DriveGetDrive('ALL') If Not IsArray($aDrive) Then Return SetError(1, 0, $sPath) EndIf For $i = 1 To $aDrive[0] $sName = _WinAPI_QueryDosDevice($aDrive[$i]) If StringInStr($sPath, $sName) = 1 Then Return StringReplace($sPath, $sName, StringUpper($aDrive[$i]), 1) EndIf Next Return SetError(2, 0, $sPath) EndFunc ;==>_DosPathNameToPathName ;Test3-------------------------------------------------------------------------------------- Func _DosPathNameToPathNameArr($sPath, ByRef $aEnumDosDevice) If Not IsArray($aEnumDosDevice) Then Return SetError(1, 0, $sPath) EndIf For $x = 0 To 1 For $i = 1 To $aEnumDosDevice[0][0] $sName = $aEnumDosDevice[1][$i] If StringInStr($sPath, $sName) = 1 Then Return StringReplace($sPath, $sName, $aEnumDosDevice[0][$i], 1) EndIf Next $aEnumDosDevice = EnumDosDeviceMapStringArr() Next Return SetError(2, 0, $sPath) EndFunc ;==>_DosPathNameToPathNameArr Func EnumDosDeviceMapStringArr() ;Make a list of found drives and their DosDevice Name ;c:=\Device\HarddiskVolume1;d:=\Device\HarddiskVolume2; Local $aDrive = DriveGetDrive('ALL') If IsArray($aDrive) Then Local $aResult[2][$aDrive[0] + 1] $aResult[0][0] = $aDrive[0] For $i = 1 To $aDrive[0] $aResult[0][$i] = StringUpper($aDrive[$i]) $aResult[1][$i] = _WinAPI_QueryDosDevice($aDrive[$i]) Next Else ConsoleWrite("Error Enumerating Drives") Return SetError(1, 0, "") EndIf Return $aResult EndFunc ;==>EnumDosDeviceMapStringArr my results: C: = \Device\HarddiskVolume11 \Device\HarddiskVolume11\Program Files\Test\myprogram\test1.exe => 301.698749422063 MS C:\Program Files\Test\myprogram\test1.exe @error = 0 \Device\HarddiskVolume11yu\Program Files\Test\myprogram\test1.exe => \Device\HarddiskVolume11yu\Program Files\Test\myprogram\test1.exe @error = 1 yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test1.exe => yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test1.exe @error = 2 \Device\HarddiskVolume11\Program Files\Test\myprogram\test2.exe => 357.898978780823 MS C:\Program Files\Test\myprogram\test2.exe @error = 0 \Device\HarddiskVolume11yu\Program Files\Test\myprogram\test2.exe => C:yu\Program Files\Test\myprogram\test2.exe @error = 0 yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test2.exe => yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test2.exe @error = 2 \Device\HarddiskVolume11\Program Files\Test\myprogram\test3.exe => 621.037589973027 MS C:\Program Files\Test\myprogram\test3.exe @error = 0 \Device\HarddiskVolume11yu\Program Files\Test\myprogram\test3.exe => C:yu\Program Files\Test\myprogram\test3.exe @error = 0 yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test3.exe => yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test3.exe @error = 2 Test1 has the added advantage of more selective matching and really shines when the dospath exists
    1 point
  16. With a bit of optimization I lopped off a few Milliseconds and made the code slightly more robust I think there are still some caveats that I don't have the ability to test atm These have to do with network drives "LanManRedirect" and possibly usb harddrives. I'd like to see some of these paths if anyone happens to run across them I'll be happy to update this function given the original paths Func EnumDosDeviceMapString() ;Make a list of found drives and their DosDevice Name ;c:*\Device\HarddiskVolume1;d:*\Device\HarddiskVolume2; Local $sResult = "" Local $aDrive = DriveGetDrive('ALL') If IsArray($aDrive) Then For $i = 1 To $aDrive[0] $sResult &= StringUpper($aDrive[$i]) & Chr(127) & _WinAPI_QueryDosDevice($aDrive[$i]) & ";" Next ;Chr(127) is the DEL Char so string will actually show as c:\Device\HarddiskVolume1 ;ConsoleWrite($sResult & @CRLF) Else ConsoleWrite("Error Enumerating Drives") Return SetError(1, 0, $sResult) EndIf Return SetError(@error, 0, $sResult) EndFunc ;==>EnumDosDeviceMapString Func GetFilePathFromDosDevicePath($DosDevicePath, ByRef $sDosDeviceMap) ;Replace DosDeviceName with Drive Letter:\ in a path ;\Device\HarddiskVolume1\Test => c:\Test Local $sDosTempName Local $TempPath Local $aResult = StringRegExp($DosDevicePath & "\\", "(?i)(^\\Device\\.+?)(?=\\)(.*)(\\\\)", 1, 1) ;\Device\HarddiskVolume part is in elem 0 the rest elem 1 and \\ in elem 2 If IsArray($aResult) Then $sDosTempName = $aResult[0] $TempPath = $aResult[1] For $i = 0 To 1 If $i = 0 And Not (StringInStr($sDosDeviceMap, $sDosTempName & ";")) Then $sDosDeviceMap = EnumDosDeviceMapString() ;Failed try to get new drive mappings ContinueLoop EndIf $aResult = StringRegExp($sDosDeviceMap, "(?i)([\S]:(?=" & Chr(127) & StringReplace($sDosTempName, "\", "\\") & ";))", 1, 1) ;Return Drive Letter :\ If IsArray($aResult) Then ;Return StringReplace($DosDevicePath, $sDosTempName, $aResult[0]) Return $aResult[0] & $TempPath Else Return SetError(1, 0, $DosDevicePath) EndIf Next EndIf Return SetError(2, 1, $DosDevicePath) EndFunc ;==>GetFilePathFromDosDevicePath New Results: \Device\HarddiskVolume11\Program Files\Test\myprogram\test1.exe => 299.170215767646 MS C:\Program Files\Test\myprogram\test1.exe @error = 0 \Device\HarddiskVolume11yu\Program Files\Test\myprogram\test1.exe => \Device\HarddiskVolume11yu\Program Files\Test\myprogram\test1.exe @error = 1 yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test1.exe => yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test1.exe @error = 2 \Device\HarddiskVolume11\Program Files\Test\myprogram\test2.exe => 343.163865798586 MS C:\Program Files\Test\myprogram\test2.exe @error = 0 \Device\HarddiskVolume11yu\Program Files\Test\myprogram\test2.exe => C:yu\Program Files\Test\myprogram\test2.exe @error = 0 yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test2.exe => yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test2.exe @error = 2 \Device\HarddiskVolume11\Program Files\Test\myprogram\test3.exe => 587.511541271307 MS C:\Program Files\Test\myprogram\test3.exe @error = 0 \Device\HarddiskVolume11yu\Program Files\Test\myprogram\test3.exe => C:yu\Program Files\Test\myprogram\test3.exe @error = 0 yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test3.exe => yu\Device\HarddiskVolume11yu\Program Files\Test\myprogram\test3.exe @error = 2 And a run with only valid paths: \Device\HarddiskVolume11\Program Files\Test\myprogram\test1.exe => 22.0635583572773 MS C:\Program Files\Test\myprogram\test1.exe @error = 0 \Device\HarddiskVolume11\Program Files\Test\myprogram\test1.exe => C:\Program Files\Test\myprogram\test1.exe @error = 0 \Device\HarddiskVolume11\Program Files\Test\myprogram\test1.exe => C:\Program Files\Test\myprogram\test1.exe @error = 0 \Device\HarddiskVolume11\Program Files\Test\myprogram\test2.exe => 111.547836387027 MS C:\Program Files\Test\myprogram\test2.exe @error = 0 \Device\HarddiskVolume11\Program Files\Test\myprogram\test2.exe => C:\Program Files\Test\myprogram\test2.exe @error = 0 \Device\HarddiskVolume11\Program Files\Test\myprogram\test2.exe => C:\Program Files\Test\myprogram\test2.exe @error = 0 \Device\HarddiskVolume11\Program Files\Test\myprogram\test3.exe => 19.30355673695959 MS C:\Program Files\Test\myprogram\test3.exe @error = 0 \Device\HarddiskVolume11\Program Files\Test\myprogram\test3.exe => C:\Program Files\Test\myprogram\test3.exe @error = 0 \Device\HarddiskVolume11\Program Files\Test\myprogram\test3.exe => C:\Program Files\Test\myprogram\test3.exe @error = 0
    1 point
  17. Hi guys! I've created this UDF to work with Nitgen fingerprint readers that use NGenBio SDK. I'm working with Hamster DX for testing purposes: So, the UDF still needs a lot of functionalities but what is already written is enough to do most of the tasks you would want to do with a fingerprint scanner (registering, authentication of a user, identification of a person among many users etc.). I've put it on GitHub because it will be constantly updated. Also, if you want to help, feel free to clone and send pull requests Examples: #include 'NGenBio.au3' ; Enumerate devices $numberOfDevices = _NEnumerate() ; Enumerate all connected devices If Not $numberOfDevices Then Exit ; no device connected _NOpen() ; Open device (no argument = open latest connected device) ; ====================================================================== ; Example 1: just get a fingerprint and display the string associated to it MsgBox(0, "Your fingerprint means:", _NCapture()) ; ====================================================================== ; Example 2: verification (expecting for a specified person) ; Ask for name (to show how to work with payloads and store info on the fingerprint data) $sName = InputBox("Test", "Enter your name") $tmpData = _NEnroll($sName) ; Register a fingerprint (we will have a string to save in DB if we want; $sName will be saved together with the data) If Not $tmpData Then Exit ; User canceled $check = _NVerify($tmpData) ; Verify fingerprint (from the string that the registration gave us - it could have come from a database) If $check Then MsgBox(0, '', 'That''s you, ' & $check & "!") ; Correct fingerprint Else MsgBox(0, '', 'That''s not you!') ; Wrong fingerprint EndIf ; ====================================================================== ; Example 3: identification (expecting for anyone of a group of persons) ; Add the already saved FIR data from the previous example as ID #1 _NSearch_Add($tmpData, 1) MsgBox(0, "", "You are now user 1. Please call someone else to register (or use different fingers/hand) to test the registration of a second person.") $secondPersonName = InputBox("Test", "What's the name of the second person?") ; Get data $secondperson = _NEnroll($secondPersonName) _NSearch_Add($secondperson, 2) ; Let's ask for the fingerprint to search for $capture = _NCapture() $user = _NSearch_Identify($capture) If $user Then MsgBox(0, "", "User: " & $user) Else MsgBox(0, "", "User not found!") EndIf _NClose() ; Close device (no argument = close latest opened device) Note that you must install NGenBio SDK (although my system is x64, I only had success after installing the x86 version). More details, documentation and link to download the SDK on the readme file. Get it on Github
    1 point
  18. AZJIO

    Converter CMD to BBcode

    Converter CMD to BBcode (En+Ru)Utility to convert (add tags) files CMD, BAT in HTML or BBcode for later putting some on the forums. Drag and drop in CMD, BAT on the utility and it will automatically perform the conversion. Try to compare the final product by copying from the forum, usually the difference may be in the gaps screenshot ConverterCMD.7z- v0.5, 300kb (exe+sources)
    1 point
  19. JScript

    MailSlot

    Wow! I had never paid attention to the item "NamedPipes Management " in the AutoIt help file! And using NamedPipes we can transfer more than the 425 bytes of the mailslot... Edit: http://www.codeproject.com/KB/threads/Win32IPC.aspx @trancexx, you could create an example of using "NamedPipes" the same way that the mailslot?
    1 point
×
×
  • Create New...