gahhon Posted January 31, 2019 Posted January 31, 2019 (edited) If FileExists($DIR_WA_FOLDER) = 0 Then Local $Decisions = _Metro_MsgBox(4, "", "Do you want to install Extension?") If $Decisions = "Yes" Then DirCopy($CUR_WA_FOLDER, $DIR_WA_FOLDER, 1) _Metro_MsgBox(0, "", "Extension is installed") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is installed.") Else _Close_Application() EndIf EndIf Due to the folder have a lot of files need to copy, so it need some time to complete the copy process. But in the meantime, how can I display a message box saying that "Installation is in progress. Please wait....", with this Metro GUI UDF design? I know that inside the Metro UDF have a function called ProgressBar, but I am not very sure how to use them with my copying progress. Please kindly advise. Here is the sample code of Metro UDF use of ProgressBar $Progress1 = _Metro_CreateProgress(100, 195, 300, 26) For $i = 0 To 85 Step +2 Sleep(1) _Metro_SetProgress($Progress1, $i) Next Here is the function declaration: expandcollapse popup; #FUNCTION# ==================================================================================================================== ; Name ..........: _Metro_CreateProgress ; Description ...: Creates a simple progressbar. ; Syntax ........: _Metro_CreateProgress($Left, $Top, $Width, $Height[, $EnableBorder = False[, $Backgroud_Color = $CB_Radio_Color[, ; $Progress_Color = $ButtonBKColor]]]) ; Parameters ....: $Left - Left pos. ; $Top - Top pos. ; $Width - Width. ; $Height - Height. ; $EnableBorder - [optional] Enables a 1px border from each side for the progressbar. Default is False. ; $Backgroud_Color - [optional] Background color. Default is $CB_Radio_Color. ; $Progress_Color - [optional] Progress color. Default is $ButtonBKColor. ; Return values .: Array containing basic information about the progressbar that is required to set the % progress. ; =============================================================================================================================== Func _Metro_CreateProgress($Left, $Top, $Width, $Height, $EnableBorder = False, $Backgroud_Color = $CB_Radio_Color, $Progress_Color = $ButtonBKColor) Local $Progress_Array[8] If $HIGHDPI_SUPPORT Then $Left = Round($Left * $gDPI) $Top = Round($Top * $gDPI) $Width = Round($Width * $gDPI) $Height = Round($Height * $gDPI) EndIf $Progress_Array[1] = $Width $Progress_Array[2] = $Height $Progress_Array[3] = "0xFF" & Hex($Backgroud_Color, 6) $Progress_Array[4] = "0xFF" & Hex($Progress_Color, 6) $Progress_Array[5] = StringReplace($CB_Radio_Hover_Color, "0x", "0xFF") $Progress_Array[7] = $EnableBorder ;Set Colors Local $ProgressBGPen = _GDIPlus_PenCreate($Progress_Array[5], 2) ;Create Graphics Local $Progress_Graphic = _iGraphicCreate($Width, $Height, $Progress_Array[3], 1, 5) ;Draw Progressbar border If $EnableBorder Then _GDIPlus_GraphicsDrawRect($Progress_Graphic[0], 0, 0, $Width, $Height, $ProgressBGPen) EndIf ;Release created objects _GDIPlus_PenDispose($ProgressBGPen) ;Create bitmap handles and set graphics $Progress_Array[0] = GUICtrlCreatePic("", $Left, $Top, $Width, $Height) $Progress_Array[6] = _iGraphicCreateBitmapHandle($Progress_Array[0], $Progress_Graphic) ;For GUI Resizing GUICtrlSetResizing($Progress_Array[0], 768) Return $Progress_Array EndFunc ;==>_Metro_CreateProgress ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Metro_SetProgress ; Description ...: Sets the progress in % of a progressbar. ; Syntax ........: _Metro_SetProgress(Byref $Progress, $Percent) ; Parameters ....: $Progress - Array of the progressbar that has been returned by _Metro_CreateProgress function. ; $Percent - A value from 0-100. (In %) ; =============================================================================================================================== Func _Metro_SetProgress(ByRef $Progress, $Percent) ;Set Colors Local $ProgressBGPen = _GDIPlus_PenCreate($Progress[5], 2) Local $ProgressBGBrush = _GDIPlus_BrushCreateSolid($Progress[4]) ;Create Graphics Local $Progress_Graphic = _iGraphicCreate($Progress[1], $Progress[2], $Progress[3], 1, 5) ;Draw Progressbar If $Percent > 100 Then $Percent = 100 If $Progress[7] Then Local $ProgressWidth = (($Progress[1] - 2) / 100) * $Percent _GDIPlus_GraphicsDrawRect($Progress_Graphic[0], 0, 0, $Progress[1], $Progress[2], $ProgressBGPen) _GDIPlus_GraphicsFillRect($Progress_Graphic[0], 1, 1, $ProgressWidth, $Progress[2] - 2, $ProgressBGBrush) Else Local $ProgressWidth = (($Progress[1]) / 100) * $Percent _GDIPlus_GraphicsFillRect($Progress_Graphic[0], 0, 0, $ProgressWidth, $Progress[2], $ProgressBGBrush) EndIf ;Release created objects _GDIPlus_PenDispose($ProgressBGPen) _GDIPlus_BrushDispose($ProgressBGBrush) ;Create bitmap handles Local $SetProgress = _iGraphicCreateBitmapHandle($Progress[0], $Progress_Graphic) _WinAPI_DeleteObject($Progress[6]) $Progress[6] = $SetProgress EndFunc ;==>_Metro_SetProgress It is not necessary need to use ProgressBar, instead I just to display some meaningful information while waiting the copy progress to complete. Thanks for advanced information. Edited January 31, 2019 by gahhon updated source
Moderators JLogan3o13 Posted January 31, 2019 Moderators Posted January 31, 2019 So you have the UDF, and you have the example script to show you how it is used. What have you tried on your own that is not working? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
gahhon Posted February 1, 2019 Author Posted February 1, 2019 6 hours ago, JLogan3o13 said: So you have the UDF, and you have the example script to show you how it is used. What have you tried on your own that is not working? The UDF example script is using For LOOP to increase the progress percentage, but how to link to real-copy progress instead? Like I said, not need to have progressbar, maybe a messagebox will do the trick.
caramen Posted February 1, 2019 Posted February 1, 2019 (edited) Post a complet sample of your code when you are copying. without see your code i could say, just add a msgbox after each DirCopy,,, For your understanding : $Progress1 = _Metro_CreateProgress(100, 195, 300, 26) For $i = 0 To 85 Step +2 Sleep(1) _Metro_SetProgress($Progress1, $i) Next If $i = 85 then metro progress show 85% bar Edited February 1, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
gahhon Posted February 1, 2019 Author Posted February 1, 2019 3 hours ago, caramen said: Post a complet sample of your code when you are copying. without see your code i could say, just add a msgbox after each DirCopy,,, For your understanding : $Progress1 = _Metro_CreateProgress(100, 195, 300, 26) For $i = 0 To 85 Step +2 Sleep(1) _Metro_SetProgress($Progress1, $i) Next If $i = 85 then metro progress show 85% bar I did posted my code when I am copying. Please kindly refer to the very top post. If FileExists($DIR_WA_FOLDER) = 0 Then Local $Decisions = _Metro_MsgBox(4, "", "Do you want to install Extension?") If $Decisions = "Yes" Then DirCopy($CUR_WA_FOLDER, $DIR_WA_FOLDER, 1) _Metro_MsgBox(0, "", "Extension is installed") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is installed.") Else _Close_Application() EndIf EndIf And also, for your information, there is no each DirCopy. Instead, there is only 1 DirCopy, but the folder contains a lot of files so it will take sometimes to copy to destination.
caramen Posted February 1, 2019 Posted February 1, 2019 (edited) 1 hour ago, gahhon said: I did posted my code when I am copying. Please kindly refer to the very top post. If FileExists($DIR_WA_FOLDER) = 0 Then Local $Decisions = _Metro_MsgBox(4, "", "Do you want to install Extension?") If $Decisions = "Yes" Then DirCopy($CUR_WA_FOLDER, $DIR_WA_FOLDER, 1) _Metro_MsgBox(0, "", "Extension is installed") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is installed.") Else _Close_Application() EndIf EndIf And also, for your information, there is no each DirCopy. Instead, there is only 1 DirCopy, but the folder contains a lot of files so it will take sometimes to copy to destination. Ok Use this UDF then : _CopyDirWithProgress($sOriginalDir, $sDestDir) expandcollapse popupFunc _CopyDirWithProgress($sOriginalDir, $sDestDir) ;$sOriginalDir and $sDestDir are quite selfexplanatory... ;This func returns: ; -1 in case of critical error, bad original or destination dir ; 0 if everything went all right ; >0 is the number of file not copied and it makes a log file ; if in the log appear as error message '0 file copied' it is a bug of some windows' copy command that does not redirect output... If StringRight($sOriginalDir, 1) <> '\' Then $sOriginalDir = $sOriginalDir & '\' If StringRight($sDestDir, 1) <> '\' Then $sDestDir = $sDestDir & '\' If $sOriginalDir = $sDestDir Then Return -1 ProgressOn('Copie en cours...', 'Liste les fichiers...' & @LF & @LF, '', -1, -1, 18) Local $aFileList = _FileSearch($sOriginalDir) If $aFileList[0] = 0 Then ProgressOff() SetError(1) Return -1 EndIf If FileExists($sDestDir) Then If Not StringInStr(FileGetAttrib($sDestDir), 'd') Then ProgressOff() SetError(2) Return -1 EndIf Else DirCreate($sDestDir) If Not FileExists($sDestDir) Then ProgressOff() SetError(2) Return -1 EndIf EndIf Local $iDirSize, $iCopiedSize = 0, $fProgress = 0 Local $c, $FileName, $iOutPut = 0, $sLost = '', $sError Local $Sl = StringLen($sOriginalDir) _Quick_Sort($aFileList, 1, $aFileList[0]) $iDirSize = Int(DirGetSize($sOriginalDir) / 1024) ProgressSet(Int($fProgress * 100), $aFileList[$c], 'Copie des fichiers:') For $c = 1 To $aFileList[0] $FileName = StringTrimLeft($aFileList[$c], $Sl) ProgressSet(Int($fProgress * 100), $aFileList[$c] & ' -> '& $sDestDir & $FileName & @LF & 'Total Kb: ' & $iDirSize & @LF & 'Done Kb: ' & $iCopiedSize, 'Copies des fichiers: ' & Round($fProgress * 100, 2) & ' % ' & $c & '/' &$aFileList[0]) If StringInStr(FileGetAttrib($aFileList[$c]), 'd') Then DirCreate($sDestDir & $FileName) Else If Not FileCopy($aFileList[$c], $sDestDir & $FileName, 1) Then If Not FileCopy($aFileList[$c], $sDestDir & $FileName, 1) Then;Tries a second time If RunWait(@ComSpec & ' /c copy /y "' & $aFileList[$c] & '" "' & $sDestDir & $FileName & '">' & @TempDir & '\o.tmp', '', @SW_HIDE)=1 Then;and a third time, but this time it takes the error message $sError = FileReadLine(@TempDir & '\o.tmp',1) $iOutPut = $iOutPut + 1 $sLost = $sLost & $aFileList[$c] & ' ' & $sError & @CRLF EndIf FileDelete(@TempDir & '\o.tmp') EndIf EndIf FileSetAttrib($sDestDir & $FileName, "+A-RSH");<- Comment this line if you do not want attribs reset. $iCopiedSize = $iCopiedSize + Int(FileGetSize($aFileList[$c]) / 1024) $fProgress = $iCopiedSize / $iDirSize EndIf Next ProgressOff() If $sLost <> '' Then;tries to write the log somewhere. If FileWrite($sDestDir & 'notcopied.txt',$sLost) = 0 Then If FileWrite($sOriginalDir & 'notcopied.txt',$sLost) = 0 Then FileWrite(@WorkingDir & '\notcopied.txt',$sLost) EndIf EndIf EndIf Return $iOutPut EndFunc ;==>_CopyDirWithProgress Func _FileSearch($sIstr, $bSF = 1) ; $bSF = 1 means looking in subfolders ; $sSF = 0 means looking only in the current folder. ; An array is returned with the full path of all files found. The pos [0] keeps the number of elements. Local $sCriteria, $sBuffer, $iH, $iH2, $sCS, $sCF, $sCF2, $sCP, $sFP, $sOutPut = '', $aNull[1] ;, $sIstr, $bSF $sCP = StringLeft($sIstr, StringInStr($sIstr, '\', 0, -1)) If $sCP = '' Then $sCP = @WorkingDir & '\' $sCriteria = StringTrimLeft($sIstr, StringInStr($sIstr, '\', 0, -1)) If $sCriteria = '' Then $sCriteria = '*.*' ;To begin we seek in the starting path. $sCS = FileFindFirstFile($sCP & $sCriteria) If $sCS <> - 1 Then Do $sCF = FileFindNextFile($sCS) If @error Then FileClose($sCS) ExitLoop EndIf If $sCF = '.' Or $sCF = '..' Then ContinueLoop $sOutPut = $sOutPut & $sCP & $sCF & @LF Until 0 EndIf ;And after, if needed, in the rest of the folders. If $bSF = 1 Then $sBuffer = @CR & $sCP & '*' & @LF;The buffer is set for keeping the given path plus a *. Do $sCS = StringTrimLeft(StringLeft($sBuffer, StringInStr($sBuffer, @LF, 0, 1) - 1), 1);current search. $sCP = StringLeft($sCS, StringInStr($sCS, '\', 0, -1));Current search path. $iH = FileFindFirstFile($sCS) If $iH <> - 1 Then Do $sCF = FileFindNextFile($iH) If @error Then FileClose($iH) ExitLoop EndIf If $sCF = '.' Or $sCF = '..' Then ContinueLoop If StringInStr(FileGetAttrib($sCP & $sCF), 'd') Then $sBuffer = @CR & $sCP & $sCF & '\*' & @LF & $sBuffer;Every folder found is added in the begin of buffer $sFP = $sCP & $sCF & '\'; for future searches $iH2 = FileFindFirstFile($sFP & $sCriteria); and checked with the criteria. If $iH2 <> - 1 Then Do $sCF2 = FileFindNextFile($iH2) If @error Then FileClose($iH2) ExitLoop EndIf If $sCF2 = '.' Or $sCF2 = '..' Then ContinueLoop $sOutPut = $sOutPut & $sFP & $sCF2 & @LF;Found items are put in the Output. Until 0 EndIf EndIf Until 0 EndIf $sBuffer = StringReplace($sBuffer, @CR & $sCS & @LF, '') Until $sBuffer = '' EndIf If $sOutPut = '' Then $aNull[0] = 0 Return $aNull Else Return StringSplit(StringTrimRight($sOutPut, 1), @LF) EndIf EndFunc ;==>_FileSearch Func _Quick_Sort(ByRef $SortArray, $First, $Last);Larry's code Dim $Low, $High Dim $Temp, $List_Separator $Low = $First $High = $Last $List_Separator = StringLen($SortArray[ ($First + $Last) / 2]) Do While (StringLen($SortArray[$Low]) < $List_Separator) $Low = $Low + 1 WEnd While (StringLen($SortArray[$High]) > $List_Separator) $High = $High - 1 WEnd If ($Low <= $High) Then $Temp = $SortArray[$Low] $SortArray[$Low] = $SortArray[$High] $SortArray[$High] = $Temp $Low = $Low + 1 $High = $High - 1 EndIf Until $Low > $High If ($First < $High) Then _Quick_Sort($SortArray, $First, $High) If ($Low < $Last) Then _Quick_Sort($SortArray, $Low, $Last) EndFunc ;==>_Quick_Sort Edited February 1, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
alienclone Posted February 1, 2019 Posted February 1, 2019 if you dont want to show progress, but just to let the user know that the files are copying, use a SplashTextOn() before your DirCopy, then a SplashOff after. If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version
mikell Posted February 1, 2019 Posted February 1, 2019 +1 for SplashTextOn() , it can be updated during the copy process while a Msgbox is blocking
Nine Posted February 1, 2019 Posted February 1, 2019 The best way to keep control under a long action is to run that action with the option run a single line of code... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
careca Posted February 1, 2019 Posted February 1, 2019 The difficulty of this is that you dont have a way to know how much of the file has been copied. Thus you cannot do the usual percentage calculation. So the best, easiest option is to have anything but that, maybe something like the marquee udf Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Nine Posted February 1, 2019 Posted February 1, 2019 1 minute ago, careca said: The difficulty of this is that you dont have a way to know how much of the file has been copied. Yes you can know how much by looking at the size of the source folder compare to the destination folder... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
water Posted February 1, 2019 Posted February 1, 2019 Maybe this copy UDF helps: My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
gahhon Posted February 1, 2019 Author Posted February 1, 2019 Actually I am don't mind using any approach to display meaning information while copying. The ProgressBar is already exist in the Metro UDF, so I might think to use it tho. But anyway, to use SplashTextOn is another useful approach tho. But I need to figure it how to use it with the Metro UDF design.
caramen Posted February 1, 2019 Posted February 1, 2019 47 minutes ago, water said: Maybe this copy UDF helps: *Sorry water i'am just out of testing it. the x64 dll is down. it worked for me during 1 day and for unknow reason it does not work anymore. And the owner is not in our community anymore sine 2016 My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
caramen Posted February 1, 2019 Posted February 1, 2019 @gahhon Look you past the 3 func in my last post at the end of your script. Then you change your code to this : If FileExists($DIR_WA_FOLDER) = 0 Then Local $Decisions = _Metro_MsgBox(4, "", "Do you want to install Extension?") If $Decisions = "Yes" Then _CopyDirWithProgress($CUR_WA_FOLDER, $DIR_WA_FOLDER) _Metro_MsgBox(0, "", "Extension is installed") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is installed.") Else _Close_Application() EndIf EndIf And you are done Give it a try. And yeah maybe this solution isn't the best one but it will work fine . If you dont care about the way used. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
gahhon Posted February 1, 2019 Author Posted February 1, 2019 If FileExists($DIR_WA_FOLDER) = 0 Then Local $Decisions = _Metro_MsgBox(4, "", "Do you want to install Extension?") If $Decisions = "Yes" Then SplashTextOn("Test", "Copying...", -1, 100, -1, -1, $DLG_TEXTLEFT, "Arial", 11, 600) DirCopy($CUR_WA_FOLDER, $DIR_WA_FOLDER, 1) Splashoff() _Metro_MsgBox(0, "", "Extension is installed") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is installed.") Else _Close_Application() EndIf EndIf I did tried this approach, but how can I change the interface into Metro GUI tho? And also It is possible to make the word "Copying..." to display like Copying then repeat . by . (3 times or 6 times)? I thinking of using WHILE-LOOP, WHILE sizeDestination <> sizeSource then use ControlSetText("Test", "", "Static1", $sMessage). In overall idea would be like this SplashTextOn("Test", $sMessage, -1, -1, -1, -1, $DLG_TEXTLEFT, "") For $i = 1 To 20 $sMessage = $sMessage & "." ControlSetText("Test", "", "Static1", $sMessage) Sleep(500) If Mod($i, 3) = 0 Then $sMessage = "Copying" EndIf Next 13 minutes ago, caramen said: @gahhon Look you past the 3 func in my last post at the end of your script. Then you change your code to this : If FileExists($DIR_WA_FOLDER) = 0 Then Local $Decisions = _Metro_MsgBox(4, "", "Do you want to install Extension?") If $Decisions = "Yes" Then _CopyDirWithProgress($CUR_WA_FOLDER, $DIR_WA_FOLDER) _Metro_MsgBox(0, "", "Extension is installed") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is installed.") Else _Close_Application() EndIf EndIf And you are done Give it a try. And yeah maybe this solution isn't the best one but it will work fine . If you dont care about the way used. @caramen I have tried your UDF, but the interface wasn't that I am needed tho. It is possible to apply your UDF approach into Metro GUI UDF, and not displaying what kind of files is being copy? Thanks for the information.
caramen Posted February 1, 2019 Posted February 1, 2019 (edited) Ahhh you whant to see the progresse without file name etc ? If yes i can rework the udf for you. But you can do it as wel. It s not so hard. Edited February 1, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
gahhon Posted February 1, 2019 Author Posted February 1, 2019 (edited) 3 hours ago, caramen said: Ahhh you whant to see the progresse without file name etc ? If yes i can rework the udf for you. But you can do it as wel. It s not so hard. I am working at it as well. But please do also, use Metro UDF as the GUI design. It would be look great if the application show every dialog boxes are the same GUI. Other than that, can try other approach displaying a text like SplashTextOn method. Then repeating the dot Example: Copying. Copying.. Copying... Edited February 1, 2019 by gahhon missing
caramen Posted February 1, 2019 Posted February 1, 2019 I ll give a shot on this this night. Nothing esle to do this week end. gahhon 1 My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
pixelsearch Posted February 1, 2019 Posted February 1, 2019 (edited) Hi all Just to share with you the simplest way to copy a folder into another one, displaying Windows native progress bar at same time : #include <AutoItConstants.au3> #include <WinAPIShellEx.au3> SplashTextOn("", "Installation in progress...", _ 250, 50, -1, 220, $DLG_NOTITLE + $DLG_TEXTVCENTER) _WinAPI_ShellFileOperation("C:\From Folder\*.*", "C:\To Folder", _ $FO_COPY, $FOF_SIMPLEPROGRESS) SplashOff() Edited February 2, 2019 by pixelsearch changed C:\From Folder => C:\From Folder\*.* caramen, FrancescoDiMuro and alienclone 3 "I think you are searching a bug where there is no bug... don't listen to bad advice."
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now