Sign in to follow this  
Followers 0
johnmcloud

[SOLVED] Question about Progress Bar

28 posts in this topic

#1 ·  Posted (edited)

Hi guys, i have two question about Progress bar,

I'm testing this code:

ProgressOn("Progress Bar", "Sample progress bar", "Working...")

For $i = 0 To 100
ProgressSet($i)
Sleep(5)
Next

MyFunc()

ProgressSet(100, "Done!")
Sleep(750)
ProgressOff()

1) Thi function does not work as expected, seem working with time, sometime finish first, sometime finish later. The func is a runwait(@comspec) can process file from 1MB to many GB, so i don't know how to set it

2) There is a version can integrate with GUI?

Thanks for support

Edited by johnmcloud

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello JohnMClound,

Look in the helpfile for the GUICtrlCreateProgress() function. It's very easy to use.

Edit: Typos :)

Edited by hannes08

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks hannes,

But the example into the help isn't so clear for me :)

It's start - stop bar, always related to time

And don't understand where insert the func()

This is the func(), just for see what do:

$Path = GUICtrlRead($FolderInput)
$Pre = @TempDir & "Test.exe"
$Command = "-a -b"
$Folders= _RecFileListToArray($Path, "*.*", 0, 0, 0, 1, "*txt", "")
$Folders[0] = "@echo off" & @CRLF

$fFlag = ""
AdlibRegister("Update",333)
For $i = 1 To UBound($Folders) - 1
If RunWait(@ComSpec & " /c " & $pre & " " & $command & " " & $Password & " " & '"' & $Path & "" & $Folders[$i] & '"', @TempDir, @SW_HIDE) = 0 Then
    ConsoleWrite("Information - Success")
    Else
        $fFlag &= $i & "|"
    EndIf
    ConsoleWrite("Information - Fail")
  
Next
If $fFlag = "" Then
If GUICtrlRead($FolderCheckbox) = $GUI_CHECKED Then
  Another_Func()
EndIf
FileDelete(@TempDir & "Test.exe")
MsgBox(0, "Information","OK") ;---> Finish Here
Else
    $aFailed = StringSplit($fFlag, "|")
    $sMsg = "Error:" & @CRLF & @CRLF
    For $i = 1 To $aFailed[0] - 1
        $sMsg &= $Folders[$aFailed[$i]] & @CRLF
    Next
FileDelete(@TempDir & "Test.exe")
    MsgBox(16, "Error", $sMsg)
EndIf
AdlibUnRegister("Update")
WinSetTitle($GUI,"","Test")
EndFunc
Edited by johnmcloud

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Guys, i need a help :)

i have make this:

#include <GuiConstantsEx.au3>
#include <ProgressConstants.au3>
#Include <SendMessage.au3>
#NoTrayIcon

$GUI = GUICreate("Test", 400, 50)
$AProgress = GUICtrlCreateProgress(20, 10, 360, 20, BitOr ($PBS_MARQUEE,$PBS_SMOOTH))
$BProgress = GUICtrlGetHandle($AProgress)
_SendMessage($BProgress, $PBM_SETMARQUEE, True, 70)
GUISetState()
 
Do
    Sleep(10)
Until GUIGetMsg() = $GUI_EVENT_CLOSE

It's like preparation bar of Windows, so is infinite. But i don't know how to set it to Start - Func() - Stop.

Thanks for support

Edited by johnmcloud

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Look at this >>

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I have a stupid question, i can set it to start total white? Without the green bar on the left?

And i need a little help to set the start - stop

Thanks guinness

Edited by johnmcloud

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

You mean like this >>

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

johnmcloud,

If your application is for a progress bar during file copy there is an example of it in this thread

Good Luck,

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

johnmcloud,

If your application is for a progress bar during file copy there is an example of it in this thread

Good Luck,

kylomas

Thanks kylomas, but is not a file copy, the cmd call an external software without GUI.

This software process a file but i don't know how many time it process, depend on file dimention. So a tradition progress bar not work because it related to time

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

You mean like this >>

Yes, but the Stop&Reset button don't reset for me, only stop the bar, and there is a way to start without the green line on the left?

Thanks for support

Edited by johnmcloud

Share this post


Link to post
Share on other sites

johnmcloud,

Progress bar's can be a couple of things, a percentage, an increment (like time), or an indicator of activity (marquee). Which are you after?

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

johnmcloud,

Progress bar's can be a couple of things, a percentage, an increment (like time), or an indicator of activity (marquee). Which are you after?

kylomas

I really don't know how use, increment is not useful because the software process file from 1MB to many GB, so it can be releated to time. Take a look to the script post at #3, i have only an array and a runwait command

Share this post


Link to post
Share on other sites

Weird, because that example resets the progress bar. What version of AutoIt & Windows are you using please? I think the marquee progress bar is the best option to show the user there is some activity happening.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

guinness,

I'm using 3361 and now i'm on XP, but the script is for all platform include Windows 7

Share this post


Link to post
Share on other sites

I'm using 3361 and now i'm on XP, but the script is for all platform include Windows 7

I would recommend firstly to download the latest version of AutoIt as this has a ton of bugfixes and improvements. Secondly try the example in the first post of that link I gave and let me know if it works.

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

guinness,

Same thing, the script with two bar work ( the stop button reset the bar ) , the script with single bar ( Stop and Reset button ) don't work, just stop. If i click again, the bar move like 1 cm and stop.

Share this post


Link to post
Share on other sites

johnmcloud,

You are trying to run a pgm (test.exe) against all "txt" type files in a folder specified by the user. If that succedds you compound the $iflag variable. Then you run anotherfunc() if $iflag is not empty and some checkbox is checked.

You are adlibing something called "update".

First - do what guinness suggests

second - come up with some code that actually runs

If you cannot comeup with the code then describe what you want to do in psuedo-logic, e.g.

get all .txt files

process each file with pgm = test.exe

if sucessfull then...

blah...

blah...

blah...

Good Luck,

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

kylomas,

You are adlibing something called "update"

Func Update()
Switch Mod($Increase,4)
  Case 0
   WinSetTitle($GUI,"","... |")
  Case 1
   WinSetTitle($GUI,"","... /")
  Case 2
   WinSetTitle($GUI,"","... —")
  Case 3
   WinSetTitle($GUI,"","... ")
EndSwitch
$Increase+=1
EndFunc

Is not useful to post this for what i need, but post is not a problem

Edited by johnmcloud

Share this post


Link to post
Share on other sites

Johnmcloud,

Maybe the screwball editor ate your code, regardless, post the whole thing.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

kylomas,

That's all the code, there is only a GUI ( incomplete ) with a button that call Func() at post #3 and an inputbox for path

The Another_Func() is a simply FileDelete() and Update() i'll post up this

Edited by johnmcloud

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • mond1106
      By mond1106
      Hi,
       
      Im new to autoit im exploring some function and I am interested with the progress bar.
       
      Is it possible to have a end user input in how much the bar will progress?
       
      I saw this code in the examples.
      Example()
      Func Example()
          ; Display a progress bar window.
          ProgressOn("Progress Meter", "Increments every second", "0%")
          ; Update the progress value of the progress bar window every second.
          For $i = 10 To 100 Step 10
            
              Sleep(1000)
              ProgressSet($i, $i & "%")
          Next
          ; Set the "subtext" and "maintext" of the progress bar window.
          ProgressSet(100, "Done", "Complete")
          Sleep(5000)
          ; Close the progress window.
          ProgressOff()
       EndFunc   ;==>Example
       
      Thank you.

    • ur
      By ur
      The below script is used by me before for copying files/folders with progress bar(windows default progress bar).
      I found similar option for moving by using same object.
      But not able to find for delete.
       dml.vbs  (This is a vbscript one and I am posting in this forum because autoit is made on top of vbscript and it might have similar functions.)
      So, I checked in AutoIT forums and found below script files and which I have been modified for my requirement.
      In those below I found delete2.au3 is working fine but hanging during deletion of huge memory files/folders.
      Delete1_au3 
      Delete2_au3 
      Delete3_au3
      Please try to provide a solution.
       
       
    • JotaPx
      By JotaPx
      Hi,
      i've been scripting around a bit with autoit but i always had this problem that i find a bit stupid on my part:
      ~Can't stop a script execution during a rotine...   "duh!" you may say   else take a look at this sample script:
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $main = GUICreate("5.5 seconds!",1100,25,125,0,-1,$WS_EX_TOPMOST) $prog = GUICtrlCreateProgress(0,0,1000,25) $OK = GUICtrlCreateButton("GO!",1000,0,25,25) $Stop = GUICtrlCreateButton("Stop",1025,0,50,25) $label = GUICtrlCreateLabel("-",1075,0,25) GUICtrlSetState($Stop,$GUI_DISABLE) GUICtrlSetState($main,$GUI_ONTOP) GUISetState() $go = 1 while 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit case $msg = $OK GUICtrlSetState($OK,$GUI_DISABLE) GUICtrlSetState($Stop,$GUI_ENABLE) Do $msg = GUIGetMsg() GUICtrlSetData($prog,0) sleep(1000) GUICtrlSetData($prog,20) sleep(1000) GUICtrlSetData($prog,40) sleep(1000) GUICtrlSetData($prog,60) sleep(1000) GUICtrlSetData($prog,80) sleep(1000) GUICtrlSetData($prog,100) sleep(250) MouseClick("left") until $msg = $GUI_EVENT_CLOSE EndSelect WEnd How can i use the Stop button to Stop the rotine? Any toughts on that?
      best regards
    • sundar
      By sundar
      I have an application which delete folder and files specified by the user. Everthing workes fine but problem comes when the file/folder size is bigger(morethan 1GB). The GUI hangs when deleting large file/folder size. The idea is to have a progress bar with looping statement when deletion is in progress. So that looping stops the hanging of GUI and progress bar shows users to know about the process/progress. However i am unable to figureout how to detect deleting process.

      Thank you in advance.
    • sundar
      By sundar
      I have been trying to do this for last 3 days but nothing seems to be working (correctly). What i am trying to do is extracting an iso image to my pendrive during which progress bar should show the process. The actual size of the archive size is not known but no significant difference is there after extraction. Here is my code and where am i making mistke?

      #include <GUIConstants.au3> #include <GUIConstantsEx.au3> _PROGRESS () Func _PROGRESS () $Progress = GUICtrlCreateProgress(8, 56, 417, 25) $Form = GUICreate("Copy File", 369, 128, 193, 126) GUISetState(@SW_SHOW) $Progress1 = GUICtrlCreateProgress(8, 56, 353, 17) $close = GUICtrlCreateButton("Close", 200, 88, 75, 25, 0) $start = GUICtrlCreateButton("Start", 80, 88, 75, 25, 0) $Source = "E:\archive.iso" $Dest = "K:\TEST\" Const $INITIAL_SIZE = DriveSpaceFree( "K:" ) Const $FILE_SIZE = FileGetSize ( $Source ) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $close ExitLoop Case $msg = $start $Extract = Run(@ScriptDir & '\7z.exe' & ' x "' & $Source & '" ' & "-y -o" & '"' & $Dest & '"', "", @SW_HIDE) Sleep (100) While ProcessExists($Extract) > 0 $SPACE_FREE = DriveSpaceFree( "K:" ) $percentage = Round((( DriveSpaceFree( "K:" ) - $INITIAL_SIZE ) * 100 / $FILE_SIZE), 0) If $percentage > 0 And $percentage < 101 Then GUICtrlSetData($Progress1,$percentage) EndIf WEnd EndSelect WEnd EndFunc
      Any help is appriciated.