JamesNL Posted May 10, 2006 Share Posted May 10, 2006 I want to create an undetermined progress bar for the script I'm writing, because I don't know how long the process will take and I can't determine the current progress of the process. Basically, an undetermined progress bar is a progress bar with a few blocks running from the left to the right (or vice-versa) of the bar, then going back again. In Windows, you can find them when searching for files, or using a wizard that uses the web (webpublishing wizard, Passport-linking-wizard). You can also find them on Windows Update, when using the Custom mode. Or in Nero 7, when you insert a disc and Nero is analyzing it. Back to the question: is this possible with AutoIt, using one of the functions or by loading a DLL? Thanks in advance! Link to comment Share on other sites More sharing options...
AutoChris Posted May 10, 2006 Share Posted May 10, 2006 I want to create an undetermined progress bar for the script I'm writing, because I don't know how long the process will take and I can't determine the current progress of the process.Basically, an undetermined progress bar is a progress bar with a few blocks running from the left to the right (or vice-versa) of the bar, then going back again.In Windows, you can find them when searching for files, or using a wizard that uses the web (webpublishing wizard, Passport-linking-wizard). You can also find them on Windows Update, when using the Custom mode. Or in Nero 7, when you insert a disc and Nero is analyzing it.Back to the question: is this possible with AutoIt, using one of the functions or by loading a DLL?Thanks in advance!You can create your own in a GUI. For example, you can use GUICtrlCreateLabel and create a square or squares. Then you can keep moving the squares to different spots, making it seem as if they are moving. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 10, 2006 Moderators Share Posted May 10, 2006 (edited) I want to create an undetermined progress bar for the script I'm writing, because I don't know how long the process will take and I can't determine the current progress of the process. Basically, an undetermined progress bar is a progress bar with a few blocks running from the left to the right (or vice-versa) of the bar, then going back again. In Windows, you can find them when searching for files, or using a wizard that uses the web (webpublishing wizard, Passport-linking-wizard). You can also find them on Windows Update, when using the Custom mode. Or in Nero 7, when you insert a disc and Nero is analyzing it. Back to the question: is this possible with AutoIt, using one of the functions or by loading a DLL? Thanks in advance!Let me just say that I'm very excited about figuring this one out on my own! What you are actually talking about is a marquee style progress bar. You have to set the control style to "PBS_MARQUEE", then send the "PBM_SETMARQUEE" message to the control. You can find more info on this at MSDN. Here is an example of working code: #include <GUIConstants.au3> Global Const $PBS_MARQUEE = 0x08 Global Const $WM_USER = 0x0400 Global Const $PBM_SETMARQUEE = ($WM_USER+10) Global $status = 1 Opt("GUIOnEventMode", 1) $GUI = GUICreate("Marquee Progress Bar", 200, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_CLOSE") $GUI_Progress = GUICtrlCreateProgress(50, 25, 100, 20, $PBS_MARQUEE) GUICtrlSendMsg($GUI_Progress, $PBM_SETMARQUEE, 1, 200) $GUI_Button = GUICtrlCreateButton("Start/Stop", 70, 50) GUICtrlSetOnEvent(-1, "Progress_Stop_Start") GUISetState() While 1 Sleep(100) WEnd Func Progress_Stop_Start() If $status Then GUICtrlSendMsg($GUI_Progress, $PBM_SETMARQUEE, 0, 200) $status = 0 Else GUICtrlSendMsg($GUI_Progress, $PBM_SETMARQUEE, 1, 200) $status = 1 EndIf EndFunc Func GUI_CLOSE() Exit EndFunc Edited May 10, 2006 by big_daddy Link to comment Share on other sites More sharing options...
AutoChris Posted May 10, 2006 Share Posted May 10, 2006 (edited) Let me just say that I'm very excited about figuring this one out on my own! What you are actually talking about is a marquee style progress bar. You have to set the control style to "PBS_MARQUEE", then send the "PBM_SETMARQUEE" message to the control. You can find more info on this at MSDN.I am very excited you figured this one out on your own too. I had no idea this could be done so easily. Methinks I shall be playing with this in the near future. Edit: See below... You forgot to put in the function for GUI_CLOSE() Func GUI_CLOSE() Exit EndFunc Edited May 10, 2006 by SerialKiller Link to comment Share on other sites More sharing options...
Zedna Posted May 10, 2006 Share Posted May 10, 2006 (edited) Great! PBM_SETMARQUEE But it's working only on WINXP and above, it's NOT working on WIN98 Edited May 10, 2006 by Zedna Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 10, 2006 Moderators Share Posted May 10, 2006 @SerialKiller - Thanks I didn't scroll all the way down when I copied. @Zenda - It requires version 6 of Comctl32.dll which is included in Microsoft Windows XP or later. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 10, 2006 Moderators Share Posted May 10, 2006 I created two UDF's for creating and controling these progress controls. You can find them here. Link to comment Share on other sites More sharing options...
JamesNL Posted May 11, 2006 Author Share Posted May 11, 2006 Hey thanks, big_daddy, just what I was looking for Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 11, 2006 Moderators Share Posted May 11, 2006 Nice Job BD... Gary did one a while ago here also before we had GUICtrlSendMsg() I believe: http://www.autoitscript.com/forum/index.ph...indpost&p=77774 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 11, 2006 Moderators Share Posted May 11, 2006 Nice Job BD... Gary did one a while ago here also before we had GUICtrlSendMsg() I believe: http://www.autoitscript.com/forum/index.ph...indpost&p=77774We'll crap, I thought I had come up with something new. Oh well, at least I learned something. 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