Necromorph Posted February 25, 2010 Share Posted February 25, 2010 i want to make this an infinite loop func so i can call it later, but im not sure how to do it. #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> GUICreate("COPYING INSTALLER", 300, 75) GUICTRLCREATELABEL("Copying Latest Installer", 25, 50) $prog = GUICtrlCreateProgress(25, 25, 250, 20, $PBS_MARQUEE) DO GUICTRLSendMsg($prog, $PBM_SETMARQUEE, True, 25) GUISetState() UNTIL THANKS Link to comment Share on other sites More sharing options...
kaotkbliss Posted February 25, 2010 Share Posted February 25, 2010 While 1 code here Wend ? 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2010 Moderators Share Posted February 25, 2010 redLabel, Does this help? #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> HotKeySet("{ESC}", "Stop_Progress") GUICreate("COPYING INSTALLER", 300, 75) GUICtrlCreateLabel("Copying Latest Installer", 25, 50) $prog = GUICtrlCreateProgress(25, 25, 250, 20, $PBS_MARQUEE) GUISetState() ; Set flag and start progress $fFlag = True GUICTRLSendMsg($prog, $PBM_SETMARQUEE, True, 25) Do Sleep(10) Until $fFlag = False ; Stop progess GUICTRLSendMsg($prog, $PBM_SETMARQUEE, False, 25) $prog = GUICtrlCreateProgress(25, 25, 250, 20) Sleep(2000) Exit Func Stop_Progress() ; Clear flag $fFlag = False EndFunc M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Necromorph Posted February 25, 2010 Author Share Posted February 25, 2010 M23, that is bout perfect, but i'm now thinking i need a better way to do it, perhaps you can help i want run the Marquee window while a file is copying, then once its done i just want to say GUIDELETE() and move on with my script, any ideas on how would be the best way to do so? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2010 Moderators Share Posted February 25, 2010 redlabel, How are you detecting the end of the file copy? M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Necromorph Posted February 25, 2010 Author Share Posted February 25, 2010 well, that is what seems to be the problem if i use the Marquee method, the "progress" stops while its copying, so if i start the marquee, it will go, then start the file copy, it will stop, then once the copy is done, it will continue once again so i would like to just have the file copy trigger the marquee, and the scripts seems to "pause" while its copying, then, once finished, just delete the gui all together. my situation is this im copying an installer package from a local network share, and it take about ten to fifteen seconds, and i want the user to see the "something" is happening while the installer package is copying from the share to there machine. and im trying to figure out the best way to do this. thanks for all your help. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2010 Moderators Share Posted February 25, 2010 redLabel, How many hints do you want! Try something like this: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> $hGui = GUICreate("COPYING INSTALLER", 300, 75) GUICtrlCreateLabel("Copying Latest Installer", 25, 50) $prog = GUICtrlCreateProgress(25, 25, 250, 20, $PBS_MARQUEE) GUISetState() ; Start progress GUICTRLSendMsg($prog, $PBM_SETMARQUEE, True, 25) ; Simulate file copy Sleep(10000) ; OK it is finished, so..... GUIDelete($hGUI) Next time try to think for yourself a bit more. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Necromorph Posted February 25, 2010 Author Share Posted February 25, 2010 that is what im saying, it doesn't keep updating the Marquee while the actual file copy is in progress, so it just "Freezes" and doesn't resume until the file copy progress is completed. in which case, no point of it at all. so i need the file copy to run "on the side" so the Marquee keeps updating as the file is copying. thanks for your replies and you help. Link to comment Share on other sites More sharing options...
kaotkbliss Posted February 25, 2010 Share Posted February 25, 2010 The only other thing I can think of is a different way instead of FileCopy that does not pause the script. Maybe command line filecopy (cmd) through dos or something? 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
kaotkbliss Posted February 25, 2010 Share Posted February 25, 2010 Another option would be to create a 2nd script. you know file size first script calls 2nd script and starts file copy 2nd script (with hidden tray icon?) opens file progress that uses the formula $progress=($current_size/$total_size)*100 when your progress bar reaches 100, then end the 2nd script. 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Necromorph Posted February 25, 2010 Author Share Posted February 25, 2010 thank you you very much for your help, do you think you could maybe make me some example script, maybe use $dir = directory $des = destination just to help me understand. but not, thank you for you help, and i will see if i can get it to work. thanks much. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2010 Moderators Share Posted February 25, 2010 redLabel,if i use the Marquee method, the "progress" stops while its copyingNo it does not - that is the whole point of the Marquee style. Have you actually tried running the code? M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Developers Jos Posted February 25, 2010 Developers Share Posted February 25, 2010 redLabel,No it does not - that is the whole point of the Marquee style. Have you actually tried running the code? M23Why aren't you just writing the whole script and a detailed user manual to help the poor creature?I know you can do it. SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Necromorph Posted February 25, 2010 Author Share Posted February 25, 2010 yes, it the progress stop once the file copy portion starts, after it is finished it resumes. my code looks like this #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> $hGui = GUICreate("COPYING INSTALLER", 300, 75) GUICtrlCreateLabel("Copying Latest Installer", 25, 50) $prog = GUICtrlCreateProgress(25, 25, 250, 20, $PBS_MARQUEE) GUISetState() GUICTRLSendMsg($prog, $PBM_SETMARQUEE, True, 25) FILECOPY("C:\DIR\TESTFOLDER\*.exe", "*.exe", 1) GUIDelete($hGUI) Link to comment Share on other sites More sharing options...
kaotkbliss Posted February 25, 2010 Share Posted February 25, 2010 (edited) I will try... say file size is 1500 for example Script 1 Run("C:\progress.exe") FileCopy($dir,$dest) script 2 (named progress.exe) #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> $total_size = 1500 $current_size = FileGetSize($dest) $progress = ($current_size / $total_size) * 100 $hGUI = GUICreate("File Progress", 300, 50, -1, -1) $prog = GUICtrlCreateProgress(3, 20, 295, 14, $PBS_SMOOTH) $current_size = FileGetSize($dest) $progress = ($current_size / $total_size) * 100 GUICtrlSetData($prog, $progress) GUISetState(@SW_SHOW, $hGUI) Do $current_size = FileGetSize($dest) $progress = ($current_size / $total_size) * 100 GUICtrlSetData($prog, $progress) Until $progress = 100 ;or you could do Until $current_size=1500 you will have to code in your $dest, $dir variables and get the correct filesize of the original file Edited February 25, 2010 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2010 Moderators Share Posted February 25, 2010 redLabel,yes, it the progress stop once the file copy portion starts, after it is finished it resumes.Then you have the weirdest setup I have ever seen. Sorry I cannot help any more.M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Necromorph Posted February 26, 2010 Author Share Posted February 26, 2010 (edited) @ kaotkbliss Thank you so much this is so close, but the progress bar is set to 100% right off the bat, so it is very close, but they do run at the same time. so it is very very close, i just need to refine the "progress.exe" a bit more, let me know if you have any more thoughts, thanks again. i think what is happening is it as soon as the file copy starts it puts the total size in the dest (even thought it isn't yet) so it does the first loop, then says "its all there", so done. Edited February 26, 2010 by redLabel Link to comment Share on other sites More sharing options...
kaotkbliss Posted February 26, 2010 Share Posted February 26, 2010 here is a 3 line code to get an exact filesize number that autoit sees on a file. maybe your numbers are off? if the problem is what you think then maybe a small pause before the filegetsize $input=InputBox("File","Full path and file name") $file=FileGetSize($input) MsgBox(0,"File Size",$file) 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
martin Posted February 26, 2010 Share Posted February 26, 2010 (edited) @redLabel. It looks like you have been struggling with filecopy and progress for some time, but I don't see that you have used methods that have been already developed. Did you search for solutions? Or did you not understand how to use them. This one for example looks like it should have helped. Edited February 26, 2010 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Necromorph Posted February 26, 2010 Author Share Posted February 26, 2010 (edited) @martin Thank you so much. this one works!! i did search before, but i didn't find this one, it is midly short and works, so its perfect, the only thing im having trouble with is i can't get it to work with wildcard* files, any ideas on that? i get "unable to open 'file'", but it does find the file just fine. i use the FINDFILEFIRST method to do this $installserver=FILEFINDFIRSTFILE("C:\test-*.exe") $packageserver=FILEFINDNEXTFILE($installserver) FILECLOSE($installserver) $FileCopy = _CopyWithProgress($packageserver, "*.exe", 5120) thanks again thought, im super close. Edited February 26, 2010 by redLabel Link to comment Share on other sites More sharing options...
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