Edifice Posted February 2, 2009 Share Posted February 2, 2009 Sorry to shower you guys with questions, but I just hit so many dead ends during the last couple of learning auto-it-days and your answers are just great! #Include <Date.au3> #Include <GuiStatusBar.au3> #include <GuiConstantsEx.au3> Dim $progress = 0 ; GUI GuiCreate("Windows Update Cleanup", 500, 100) ; PROGRESS GUICtrlCreateLabel("Progress...",65, 40, 400, 20, 1) GuiCtrlCreateProgress(65, 10, 400, 20) GuiCtrlSetData(-1, $progress) GUISetState(@SW_SHOW) After drawing this lovely little GUI-Window i used GuiCtrlSetData(-1, $progress) to update the progressbar, and it works flawlessly, but I know it's not the right way to go, as you would then only be able to update one GUI-item in the entire window (this being the last one created). My question is then, how do I update several GUI-thingy's? Link to comment Share on other sites More sharing options...
youknowwho4eva Posted February 2, 2009 Share Posted February 2, 2009 I'm lost as to what you want to do that it's not doing? Giggity Link to comment Share on other sites More sharing options...
Authenticity Posted February 2, 2009 Share Posted February 2, 2009 Use the returned control ID and then use it... Link to comment Share on other sites More sharing options...
SpookMeister Posted February 2, 2009 Share Posted February 2, 2009 Assign variables to hold the Control ID's of the GUI items you are creating, then you can later reference them #Include <Date.au3> #Include <GuiStatusBar.au3> #include <GuiConstantsEx.au3> Dim $progress = 0 ; GUI GuiCreate("Windows Update Cleanup", 500, 100) ; PROGRESS $label=GUICtrlCreateLabel("Progress...",65, 40, 400, 20, 1) $prog=GuiCtrlCreateProgress(65, 10, 400, 20) GuiCtrlSetData($prog, 25) GUISetState(@SW_SHOW) [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
Edifice Posted February 2, 2009 Author Share Posted February 2, 2009 A bit lower down I used While $progress < 10 ; Increase the count by one $progress = $progress + 1 GuiCtrlSetData(-1, $progress) Sleep(50) Wend To update the progressbar, but the funny thing is that if I draw the label after the progressbar, the $progress goes into the label instead. Link to comment Share on other sites More sharing options...
Edifice Posted February 2, 2009 Author Share Posted February 2, 2009 And Again, Thank you Spookmeister Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 2, 2009 Moderators Share Posted February 2, 2009 Edifice,Using -1 in GUICtrlSetData (or any other similar function) is shorthand for the last control created.If you want to reference any other controls then you need to assign a variable to hold the Control ID when it is created:$hLabel = GUICtrlCreateLabel(......)and then use that variable to reference the control later on:GUICtrlSetData($hLabel, ....)You can now address as many controls as Autoit can manage (65532 to save you the trouble of looking it up!)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...
Edifice Posted February 2, 2009 Author Share Posted February 2, 2009 Now just a bonus question. How do I set my window as "Always on top"? Link to comment Share on other sites More sharing options...
Authenticity Posted February 2, 2009 Share Posted February 2, 2009 Use GuiCreate('Text', 200, 185, 10, 100, -1, $WS_EX_TOPMOST) $WS_EX_TOPMOST is defined in WindowsConstants.au3 Link to comment Share on other sites More sharing options...
jvanegmond Posted February 2, 2009 Share Posted February 2, 2009 Now just a bonus question. How do I set my window as "Always on top"?I usually do .. $hWnd = GuiCreate("Windows Update Cleanup", 500, 100) WinSetOnTop($hWnd,"",1) github.com/jvanegmond 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