-
Posts
2,651 -
Joined
-
Last visited
-
Days Won
40
Danyfirex last won the day on March 31 2022
Danyfirex had the most liked content!
About Danyfirex

- Birthday 04/04/1915
Profile Information
-
Member Title
DanysysTeam
-
WWW
https://danysys.com/
Recent Profile Visitors
6,501 profile views
Danyfirex's Achievements
-
Parsix reacted to a post in a topic: Microsoft Edge - WebView2, embed web code in your native application
-
Parsix reacted to a post in a topic: Microsoft Edge - WebView2, embed web code in your native application
-
jugador reacted to a post in a topic: Microsoft Edge - WebView2, embed web code in your native application
-
Danyfirex reacted to a post in a topic: [Completed] Volunteers wanted 👀 to test an AutoIt + SQLite project
-
Danyfirex reacted to a post in a topic: Microsoft Edge - WebView2, embed web code in your native application
-
Danyfirex reacted to a post in a topic: Microsoft Edge - WebView2, embed web code in your native application
-
Danyfirex reacted to a post in a topic: Microsoft Edge - WebView2, embed web code in your native application
-
ptrex reacted to a post in a topic: Microsoft Edge - WebView2, embed web code in your native application
-
mLipok reacted to a post in a topic: Microsoft Edge - WebView2, embed web code in your native application
-
Gianni reacted to a post in a topic: Microsoft Edge - WebView2, embed web code in your native application
-
Hello friends, I haven't used AutoIt for a long time, but I always like these challenges, and I never forget you. Apparently there is some bug in how GUICtrlCreateObj works and I don't have time to look internally at the bug. This way I was able to create the instance of the object. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global Const $gATL = DllOpen("ATL.DLL") Global Const $gOleaut32 = DllOpen("oleaut32.dll") Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") _TestOrdoWebView() Func _TestOrdoWebView() ConsoleWrite("AtlAxWinInit: " & AtlAxWinInit() & @CRLF) Local $pProgID = SysAllocString('OrdoWebView2.OrdoWebView') ConsoleWrite("SysAllocString('OrdoWebView2.OrdoWebView'): " & $pProgID & @CRLF) Local $hGUI = GUICreate("OrdoWebView2.OrdoWebView Test", (@DesktopWidth) / 1.2, (@DesktopHeight) / 1.2, Default, Default, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN)) Local $hResult = AtlAxCreateControl($pProgID, $hGUI) _SysFreeString($pProgID) Local $pIUnkown = AtlAxGetControl($hGUI) ConsoleWrite("AtlAxGetControl: " & $pIUnkown & @CRLF) GUISetState() Local $oOrdoWebView2 = ObjCreateInterface($pIUnkown, "{E54909AA-1705-44A9-8235-B24F74366B3F}") Local $oOrdoWebViewEvents = ObjEvent($oOrdoWebView2, "_OrdoWebView_", "__OrdoWebView") ConsoleWrite("$oOrdoWebView2: " & IsObj($oOrdoWebView2) & @CRLF) ConsoleWrite($oOrdoWebView2.GetWebView2Version() & @CRLF) ConsoleWrite($oOrdoWebView2.GetMostRecentInstallPath() & @CRLF) $oOrdoWebView2.Anchor = True $oOrdoWebView2.Search_URL = "https://search.yahoo.com/search?p=%1" $oOrdoWebView2.HomeURL = "http://www.google.com" $oOrdoWebView2.SearchEngine = 2 $oOrdoWebView2.SearchAuto = True $oOrdoWebView2.Init() While Not $oOrdoWebView2.IsWebViewInit() ;wait initialization otherwise Navigate will fail Sleep(100) WEnd $oOrdoWebView2.Navigate("https://www.autoitscript.com/forum/topic/204362-microsoft-edge-webview2-embed-web-code-in-your-native-application/page/9/#findComment-1542505") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>_TestOrdoWebView Func _OrdoWebView_InitComplete($oIEpDisp) ConsoleWrite("_OrdoWebView_InitComplete" & @CRLF) EndFunc ;==>_OrdoWebView_InitComplete Func AtlAxCreateControl($pProgID, $HWND) Local $aCall = DllCall($gATL, "long", "AtlAxCreateControl", "ptr", $pProgID, "handle", $HWND, "ptr", 0, "ptr", 0) If @error Then Return SetError(1, 0, -1) Return $aCall[0] EndFunc ;==>AtlAxCreateControl Func AtlAxGetControl($HWND) Local $aCall = DllCall($gATL, "long", "AtlAxGetControl", "handle", $HWND, "ptr*", 0) If @error Then Return SetError(1, 0, -1) Return $aCall[2] EndFunc ;==>AtlAxGetControl Func AtlAxWinInit() Local $aCall = DllCall($gATL, "bool", "AtlAxWinInit") If @error Then Return SetError(1, 0, -1) Return $aCall[0] EndFunc ;==>AtlAxWinInit Func _SysFreeString($pBSTR) ; Author: Prog@ndy If Not $pBSTR Then Return SetError(2, 0, 0) DllCall($gOleaut32, "none", "SysFreeString", "ptr", $pBSTR) If @error Then Return SetError(1, 0, 0) EndFunc ;==>_SysFreeString Func SysAllocString($str) ; Author: monoceres Local $aCall = DllCall($gOleaut32, "ptr", "SysAllocString", "wstr", $str) If @error Then Return SetError(1, 0, 0) Return $aCall[0] EndFunc ;==>SysAllocString ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc Saludos
-
Danyfirex reacted to a post in a topic: MiniMark (a minimalistic rtf editor)
-
Danyfirex reacted to a post in a topic: Shell Application Bar
-
Danyfirex reacted to a post in a topic: Hex Edit Functions
-
Danyfirex reacted to a post in a topic: Round Corner GUI and Controls UDF
-
Danyfirex reacted to a post in a topic: CodeLocalizationAU3
-
SkysLastChance reacted to a post in a topic: Exit 1. Yet $? and $LastExitCode not working
-
WarMan reacted to a post in a topic: UWPOCR - Windows Platform Optical character recognition API Implementation
-
Parsix reacted to a post in a topic: Array of Structures
-
MsgBox window position not in the middle of the screen
Danyfirex replied to antai's topic in AutoIt General Help and Support
Hello, Another alternative. #include <WinAPIProc.au3> #include <WinAPI.au3> #include <GUIConstants.au3> Global $hGUI = GUICreate("GUI") Global $idbtnOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) GUISetState(@SW_SHOW, $hGUI) GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), 'WM_SHELLHOOK') _WinAPI_RegisterShellHookWindow($hGUI) Local $nMsg = 0 While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE ExitLoop Case $nMsg = $idbtnOK _MsgBox(0, "", "Hello I'm an AutoIt Msgbox at Default Position :-)") _MsgBox(0, "", "Hello I'm an AutoIt Msgbox at 10,10 Position :-)", 10, 10) _MsgBox(0, "", "Hello I'm an AutoIt Msgbox at " & @DesktopWidth - 300 & "," & @DesktopHeight - 300 & " Position :-)", @DesktopWidth - 300, @DesktopHeight - 300) _MsgBox(0, "", "Hello I'm an AutoIt Msgbox at 0,0 Position :-)", 0, 0) EndSelect WEnd _WinAPI_DeregisterShellHookWindow($hGUI) Exit Func _MsgBoxPostition($X = Default, $Y = Default) Local Static $aPos[] = [Default, Default] If $X = Default Or $Y = Default Then Return $aPos EndIf $aPos[0] = $X $aPos[1] = $Y EndFunc ;==>_MsgBoxPostition Func _MsgBox($iFlag, $Title, $Text, $X = Default, $Y = Default, $iTimeout = Default, $hWnd = Default) _MsgBoxPostition($X, $Y) MsgBox($iFlag, $Title, $Text, $iTimeout, $hWnd) EndFunc ;==>_MsgBox Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg Switch $wParam Case $HSHELL_WINDOWCREATED If WinGetProcess($lParam) = @AutoItPID And _WinAPI_GetClassName($lParam) = "#32770" Then Local $aPos = _MsgBoxPostition() If $aPos[0] <> Default And $aPos[1] <> Default Then WinMove($lParam, "", $aPos[0], $aPos[1]) EndIf EndIf EndSwitch EndFunc ;==>WM_SHELLHOOK Saludos -
You would need to build some unique pattern. I've done things similar for for number before and worked perfectly. It is just a sample to handle it. but for sure it will work if you add a correct pattern for each number. Saludos
-
Here my two cents. #include <GDIPlus.au3> Example() Func Example() _GDIPlus_Startup() ;initialize GDI+ Local Const $iWidth = 150, $iHeight = 150 Local $iColor = 0 Local $hBitmap = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\TestImage.png") Local $Y0 = 0 For $iY = 0 To $iHeight - 1 For $iX = 0 To $iWidth - 1 $iColor = _GDIPlus_BitmapGetPixel($hBitmap, $iX, $iY) ;get current pixel color If $iColor = 4278255360 Then ;~ _GDIPlus_BitmapSetPixel($hBitmap, $iX, $iY, 0xFFFF0000) ;~ ConsoleWrite($iX & "," & $iY & @CRLF) $Y0 = $iY ExitLoop 2 EndIf Next Next ;Find X Local $X0 = 0 For $iX = 0 To $iWidth - 1 For $iY = 0 To $iHeight - 1 $iColor = _GDIPlus_BitmapGetPixel($hBitmap, $iX, $iY) ;get current pixel color If $iColor = 4278255360 Then ;~ _GDIPlus_BitmapSetPixel($hBitmap, $iX, $iY, 0xFFFF0000) ;~ ConsoleWrite($iX & "," & $iY & @CRLF) $X0 = $iX ExitLoop 2 EndIf Next Next ;~ _GDIPlus_BitmapSetPixel($hBitmap, $X0, $Y0, 0xFFFF0000) ConsoleWrite("TOP CORNER TEXT: " & $X0 & "," & $Y0 & @CRLF) Local $iFieldSizePixel14 = 16 Local $sNumber = "" For $iX = $X0 To $iWidth - 1 Step $iFieldSizePixel14 $sNumber &= _NumberFromPattern($hBitmap, $iX, $Y0) Next ConsoleWrite("Number: " & $sNumber & @CRLF) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() EndFunc ;==>Example Func _NumberFromPattern(ByRef $hBitmap, $X0, $Y0) Local $a3[] = ["0,4", "6,9"] Local $a7[] = ["0,0", "13,0"] Local $a4[] = ["9,0", "0,9"] Local $aSplit = 0 Local $iCount = 0 For $i = 0 To UBound($a3) - 1 $aSplit = StringSplit($a3[$i], ",", 2) If _GDIPlus_BitmapGetPixel($hBitmap, $X0 + ($aSplit[0]), $Y0 + ($aSplit[1])) = 4278255360 Then $iCount += 1 EndIf Next If $iCount = UBound($aSplit) Then Return 3 $iCount = 0 For $i = 0 To UBound($a7) - 1 $aSplit = StringSplit($a7[$i], ",", 2) If _GDIPlus_BitmapGetPixel($hBitmap, $X0 + ($aSplit[0]), $Y0 + ($aSplit[1])) = 4278255360 Then $iCount += 1 EndIf Next If $iCount = UBound($aSplit) Then Return 7 $iCount = 0 For $i = 0 To UBound($a4) - 1 $aSplit = StringSplit($a4[$i], ",", 2) If _GDIPlus_BitmapGetPixel($hBitmap, $X0 + ($aSplit[0]), $Y0 + ($aSplit[1])) = 4278255360 Then $iCount += 1 EndIf Next If $iCount = UBound($aSplit) Then Return 4 Return "" EndFunc ;==>_NumberFromPattern Using the image from here. You just need to build the pattern for the other numbers and try to make them unique. Saludos
-
Why does input box take so long to display?
Danyfirex replied to MattHiggs's topic in AutoIt General Help and Support
Remove the Sleep(1000) Saludos -
Hello. Here is a sample. #AutoIt3Wrapper_UseX64=n ;~ #RequireAdmin #include <WinAPISysWin.au3> #include ".\UIASpy\Includes\UIA_Constants.au3" HotKeySet("{ESC}", "Quit") ;Press ESC key to quit _Test() Func Quit() Exit EndFunc ;==>Quit Func _Test() ; Create UI Automation object Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtag_IUIAutomation) If Not IsObj($oUIAutomation) Then Return ConsoleWrite("$oUIAutomation ERR" & @CRLF) ConsoleWrite("$oUIAutomation OK" & @CRLF) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement($pDesktop) $oDesktop = ObjCreateInterface($pDesktop, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oDesktop) Then Return ConsoleWrite("$oDesktop ERR" & @CRLF) ConsoleWrite("$oDesktop OK" & @CRLF) While Sleep(30) Local $hHandle = WinGetHandle("[ACTIVE]") If _WinAPI_GetClassName($hHandle) <> "Chrome_WidgetWin_1" Then ContinueLoop ConsoleWrite(WinGetTitle($hHandle) & @CRLF) Local $pCondition ; Note that $UIA_ClassNamePropertyId maybe ia a CASE SENSITIVE condition $oUIAutomation.CreatePropertyCondition($UIA_NativeWindowHandlePropertyId, Int($hHandle), $pCondition) ;hwnd need to be converted to int If Not $pCondition Then ContinueLoop ConsoleWrite("$pCondition OK") ;When searching for top-level windows on the desktop, be sure to specify TreeScope_Children in the scope parameter, not TreeScope_Descendants. ;A search through the entire subtree of the desktop could iterate through thousands of items and lead to a stack overflow. Local $pWindow $oDesktop.FindFirst($TreeScope_Children, $pCondition, $pWindow) Local $oWindow = ObjCreateInterface($pWindow, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oWindow) Then ContinueLoop ConsoleWrite("$oWindow OK") Local $pCondition0 $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0) If Not $pCondition0 Then ContinueLoop ConsoleWrite("$pCondition0 OK" & @CRLF) Local $pPaneChrome, $oPaneChrome $oWindow.FindFirst($TreeScope_Descendants, $pCondition0, $pPaneChrome) $oPaneChrome = ObjCreateInterface($pPaneChrome, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oPaneChrome) Then ContinueLoop ConsoleWrite("$oPaneChrome OK" & @CRLF) Local $pCondition0 $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_PaneControlTypeId, $pCondition0) If Not $pCondition0 Then ContinueLoop ConsoleWrite("$pCondition0 OK" & @CRLF) Local $pPaneFirst, $oPaneFirst $oPaneChrome.FindFirst($TreeScope_Children, $pCondition0, $pPaneFirst) $oPaneFirst = ObjCreateInterface($pPaneFirst, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oPaneFirst) Then ContinueLoop ConsoleWrite("$oPaneFirst OK" & @CRLF) Local $pCondition1 $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_TextControlTypeId, $pCondition1) If Not $pCondition1 Then ContinueLoop ConsoleWrite("$pCondition1 OK" & @CRLF) Local $pText1, $oText1 $oPaneFirst.FindFirst($TreeScope_Descendants, $pCondition1, $pText1) $oText1 = ObjCreateInterface($pText1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oText1) Then ContinueLoop ConsoleWrite("$oText1 OK" & @CRLF) Local $sValue = "" $oText1.GetCurrentPropertyValue($UIA_NamePropertyId, $sValue) ConsoleWrite($sValue & @CRLF) ToolTip($sValue,Default,Default,"Link") WEnd EndFunc ;==>_Test Saludos
-
Maybe this; Local Const $tagIDispatch = _ "GetTypeInfoCount hresult(dword*);" & _ "GetTypeInfo hresult(dword;dword;ptr*);" & _ "GetIDsOfNames hresult(struct*;struct*;dword;dword;struct*);" & _ "Invoke hresult(uint;struct*;dword;word;struct*;struct*;ptr;uint*);" Local Const $sIID_INetworkConnection = "{DCB00005-570F-4A9B-8D69-199FDBA5723B}" Local Const $sTag_INetworkConnection = $tagIDispatch & _ "GetNetwork hresult()" & _ "IsConnectedToInternet hresult();" & _ "IsConnected hresult();" & _ "GetConnectivity hresult();" & _ "GetConnectionId hresult();" & _ "GetAdapterId hresult(clsid*);" & _ "GetDomainType hresult(int*);" Local $oObj = ObjCreate("{DCB00C01-570F-4A9B-8D69-199FDBA5723B}") ;NetworkListManager Local $oConnections = $oObj.GetNetworkConnections() For $oConnection In $oConnections Local $oConnectionCast = ObjCreateInterface($oConnection, $sIID_INetworkConnection, $sTag_INetworkConnection) Local $GUID = "" Local $iDomainType=0 $oConnectionCast.GetAdapterId($GUID) $oConnectionCast.GetDomainType($iDomainType) ConsoleWrite("GetAdapterId: " & $GUID & @CRLF) ConsoleWrite("GetDomainType: " & $iDomainType & @CRLF) ;~ ConsoleWrite($oConnection.GetAdapterId & @CRLF) ;this will not work ;~ ConsoleWrite($oConnection.GetDomainType & @CRLF) ;this will work Next Saludos
-
Hello. Nice to find another Otaku here 🤣 I'm getting similar issue like Chimp (Sorry I meant @Gianni 🙊) look my screenshot Saludos
-
I really don't know much about which one is better only that it gave me better results than tesseract in a project I was doing so that's why I made the wrapper. Saludos
- 3 replies
-
- ocr
- text recognition
-
(and 2 more)
Tagged with:
-
AutoIT Window info tool not displaying control text
Danyfirex replied to MattHiggs's topic in AutoIt General Help and Support
You're right inspect tool don't show the text but element is on top. weird. Saludos -
@jchd I meant make sure Your script and the Firefox instance are both same arch. (just to skip it could be the issue) also Can You try to find all edits with condition $UIA_ControlTypePropertyId, $UIA_EditControlTypeId? Saludos
-
For sure it works with Group using the condition: $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_GroupControlTypeId, $pCondition) are you using correct Arch x64/x86 to be sure is not related to it. Edit: Can You try to find all edits with condition $UIA_ControlTypePropertyId, $UIA_EditControlTypeId? Saludos
-
I was needing to copy some files something like a backup of a folder without overwrite file. I found in this thread a suggestion to use _WinAPI_ShellFileOperation but for my surprise it does overwrite files all the time 🤔. So I was checking MSDN and found out that IFileOperation implemented a nice operation flag to handle what I was needing(FOFX_KEEPNEWERFILE) so I just wrote this sample in case anyone was looking for it. #include <WinAPIShellEx.au3> ;~ Global Const $FOF_ALLOWUNDO = 0x40 ;~ Global Const $FOF_CONFIRMMOUSE = 0x2 ;~ Global Const $FOF_FILESONLY = 0x80 ;~ Global Const $FOF_MULTIDESTFILES = 0x1 ;~ Global Const $FOF_NO_CONNECTED_ELEMENTS = 0x2000 ;~ Global Const $FOF_NOCONFIRMATION = 0x10 ;~ Global Const $FOF_NOCONFIRMMKDIR = 0x200 ;~ Global Const $FOF_NOCOPYSECURITYATTRIBS = 0x800 ;~ Global Const $FOF_NOERRORUI = 0x400 ;~ Global Const $FOF_NORECURSION = 0x1000 ;~ Global Const $FOF_RENAMEONCOLLISION = 0x8 ;~ Global Const $FOF_SILENT = 0x4 ;~ Global Const $FOF_SIMPLEPROGRESS = 0x100 ;~ Global Const $FOF_WANTMAPPINGHANDLE = 0x20 ;~ Global Const $FOF_WANTNUKEWARNING = 0x4000 Global Const $FOFX_ADDUNDORECORD = 0x20000000 Global Const $FOFX_NOSKIPJUNCTIONS = 0x00010000 Global Const $FOFX_PREFERHARDLINK = 0x00020000 Global Const $FOFX_SHOWELEVATIONPROMPT = 0x00040000 Global Const $FOFX_EARLYFAILURE = 0x00100000 Global Const $FOFX_PRESERVEFILEEXTENSIONS = 0x00200000 Global Const $FOFX_KEEPNEWERFILE = 0x00400000 Global Const $FOFX_NOCOPYHOOKS = 0x00800000 Global Const $FOFX_NOMINIMIZEBOX = 0x01000000 Global Const $FOFX_MOVEACLSACROSSVOLUMES = 0x02000000 Global Const $FOFX_DONTDISPLAYSOURCEPATH = 0x04000000 Global Const $OFX_DONTDISPLAYDESTPATH = 0x08000000 Global Const $FOFX_RECYCLEONDELETE = 0x00080000 Global Const $FOFX_REQUIREELEVATION = 0x10000000 Global Const $FOFX_COPYASDOWNLOAD = 0x40000000 Global Const $FOFX_DONTDISPLAYLOCATIONS = 0x80000000 Global Const $IID_IShellItem = "{43826d1e-e718-42ee-bc55-a1e261c37bfe}" Global Const $dtag_IShellItem = _ "BindToHandler hresult(ptr;clsid;clsid;ptr*);" & _ "GetParent hresult(ptr*);" & _ "GetDisplayName hresult(int;ptr*);" & _ "GetAttributes hresult(int;int*);" & _ "Compare hresult(ptr;int;int*);" Global Const $IID_IShellItemArray = "{b63ea76d-1f85-456f-a19c-48159efa858b}" Global Const $dtagIShellItemArray = "BindToHandler hresult();GetPropertyStore hresult();" & _ "GetPropertyDescriptionList hresult();GetAttributes hresult();GetCount hresult(dword*);" & _ "GetItemAt hresult();EnumItems hresult();" Global Const $BHID_EnumItems = "{94F60519-2850-4924-AA5A-D15E84868039}" Global Const $IID_IEnumShellItems = "{70629033-e363-4a28-a567-0db78006e6d7}" Global Const $dtagIEnumShellItems = "Next hresult(ulong;ptr*;ulong*);Skip hresult();Reset hresult();Clone hresult();" Global Const $CLSID_IFileOperation = "{3AD05575-8857-4850-9277-11B85BDB8E09}" Global Const $IID_IFileOperation = "{947AAB5F-0A5C-4C13-B4D6-4BF7836FC9F8}" Global Const $dtagIFileOperation = "Advise hresult(ptr;dword*);" & _ "Unadvise hresult(dword);" & _ "SetOperationFlags hresult(dword);" & _ "SetProgressMessage hresult(wstr);" & _ "SetProgressDialog hresult(ptr);" & _ "SetProperties hresult(ptr);" & _ "SetOwnerWindow hresult(hwnd);" & _ "ApplyPropertiesToItem hresult(ptr);" & _ "ApplyPropertiesToItems hresult(ptr);" & _ "RenameItem hresult(ptr;wstr;ptr);" & _ "RenameItems hresult(ptr;wstr);" & _ "MoveItem hresult(ptr;ptr;wstr;ptr);" & _ "MoveItems hresult(ptr;ptr);" & _ "CopyItem hresult(ptr;ptr;wstr;ptr);" & _ "CopyItems hresult(ptr;ptr);" & _ "DeleteItem hresult(ptr;ptr);" & _ "DeleteItems hresult(ptr);" & _ "NewItem hresult(ptr;dword;wstr;wstr;ptr);" & _ "PerformOperations hresult();" & _ "GetAnyOperationsAborted hresult(ptr*);" _Test() Func _Test() Local $sPathFrom = @ScriptDir & "\PathFrom\" Local $sPathTo = @ScriptDir & "\PathTo\" DirRemove($sPathFrom, 1) DirRemove($sPathTo, 1) DirCreate($sPathFrom) For $i = 1 To 5000 FileWrite($sPathFrom & $i & ".txt", "Hello World - " & $i) Next _WinAPI_ShellFileOperation($sPathFrom & "*.*", $sPathTo, $FO_COPY, BitOR($FOF_NOERRORUI, $FOF_NOCONFIRMATION)) ;update file From and To FileWrite($sPathFrom & 1 & ".txt", " Only this should be update in 'To' Folder") FileWrite($sPathTo & 2 & ".txt", " This should not be overwritten but it does :(") MsgBox(0, "ShellFileOperation", "Check these files: " & @CRLF & $sPathFrom & 1 & ".txt" & @CRLF & @CRLF & $sPathTo & 2 & ".txt") _WinAPI_ShellFileOperation($sPathFrom & "*.*", $sPathTo, $FO_COPY, BitOR($FOF_NOERRORUI, $FOF_NOCONFIRMATION)) MsgBox(0, "ShellFileOperation", "Check these files: " & @CRLF & $sPathFrom & 1 & ".txt" & @CRLF & @CRLF & $sPathTo & 2 & ".txt") ;update file From and To FileWrite($sPathFrom & 1 & ".txt", " - I was updated again :-S") FileWrite($sPathTo & 2 & ".txt", " This will not be overwritten :)") MsgBox(0, "IFileOperation", "Check these files: " & @CRLF & $sPathFrom & 1 & ".txt" & @CRLF & @CRLF & $sPathTo & 2 & ".txt") _IFileOperationCopyFiles($sPathFrom, $sPathTo) MsgBox(0, "IFileOperation", "Check these files: " & @CRLF & $sPathFrom & 1 & ".txt" & @CRLF & @CRLF & $sPathTo & 2 & ".txt") DirRemove($sPathFrom, 1) DirRemove($sPathTo, 1) EndFunc ;==>_Test Func _IFileOperationCopyFiles($sPathFrom, $sPathTo, $iFlags = BitOR($FOF_NOERRORUI, $FOFX_KEEPNEWERFILE, $FOFX_NOCOPYHOOKS, $FOF_NOCONFIRMATION)) If Not FileExists($sPathFrom) Then Return SetError(1, 0, False) EndIf If Not FileExists($sPathTo) Then DirCreate($sPathTo) EndIf Local $tIIDIShellItem = CLSIDFromString($IID_IShellItem) Local $tIIDIShellItemArray = CLSIDFromString($IID_IShellItemArray) Local $oIFileOperation = ObjCreateInterface($CLSID_IFileOperation, $IID_IFileOperation, $dtagIFileOperation) If Not IsObj($oIFileOperation) Then Return SetError(2, 0, False) Local $pIShellItemFrom = 0 Local $pIShellItemTo = 0 _SHCreateItemFromParsingName($sPathFrom, 0, DllStructGetPtr($tIIDIShellItem), $pIShellItemFrom) _SHCreateItemFromParsingName($sPathTo, 0, DllStructGetPtr($tIIDIShellItem), $pIShellItemTo) If Not $pIShellItemFrom Or Not $pIShellItemTo Then Return SetError(3, 0, False) Local $oIShellItem = ObjCreateInterface($pIShellItemFrom, $IID_IShellItem, $dtag_IShellItem) Local $pEnum = 0 $oIShellItem.BindToHandler(0, $BHID_EnumItems, $IID_IEnumShellItems, $pEnum) Local $oIEnumShellItems = ObjCreateInterface($pEnum, $IID_IEnumShellItems, $dtagIEnumShellItems) If Not $pEnum Then Return SetError(4, 0, False) $oIFileOperation.SetOperationFlags($iFlags) Local $pItem = 0 Local $iFeched = 0 While $oIEnumShellItems.Next(1, $pItem, $iFeched) = 0 $oIFileOperation.CopyItems($pItem, $pIShellItemTo) WEnd Return $oIFileOperation.PerformOperations() = 0 EndFunc ;==>_IFileOperationCopyFiles Func _SHCreateItemFromParsingName($szPath, $pbc, $riid, ByRef $pv) Local $aRes = DllCall("shell32.dll", "long", "SHCreateItemFromParsingName", "wstr", $szPath, "ptr", $pbc, "ptr", $riid, "ptr*", 0) If @error Then Return SetError(1, 0, @error) $pv = $aRes[4] Return $aRes[0] EndFunc ;==>_SHCreateItemFromParsingName Func CLSIDFromString($sString) Local $tCLSID = DllStructCreate("dword;word;word;byte[8]") Local $aRet = DllCall("Ole32.dll", "long", "CLSIDFromString", "wstr", $sString, "ptr", DllStructGetPtr($tCLSID)) If @error Then Return SetError(1, 0, @error) If $aRet[0] <> 0 Then Return SetError(2, $aRet[0], 0) Return $tCLSID EndFunc ;==>CLSIDFromString Saludos