ConsultingJoe Posted September 13, 2007 Share Posted September 13, 2007 (edited) This may be very helpful to understanding the different types of progress bars that you can easily add into your projects. Enjoy. expandcollapse popup#include <GUIConstants.au3> ;Global Const $PBS_SMOOTH = 0x00000001 ; The progress bar displays progress status in a smooth scrolling bar ;Global Const $PBS_VERTICAL = 0x00000004 ; The progress bar displays progress status vertically Global Const $PBS_MARQUEE = 0x00000008 ; The progress bar moves like a marquee Global $i=0 ; Create GUI $Form1 = GUICreate("Progress Demo By CyberZeroCool", 401, 301, 341, 258) $Progress1 = GUICtrlCreateProgress(0, 0, 25, 297, BitOR($PBS_SMOOTH,$PBS_VERTICAL,$PBS_MARQUEE)) $Progress2 = GUICtrlCreateProgress(104, 0, 289, 25) $Progress3 = GUICtrlCreateProgress(104, 56, 289, 25, $PBS_MARQUEE) $Label1 = GUICtrlCreateLabel("-1 (NO STYLE)", 104, 32, 75, 17) $Label2 = GUICtrlCreateLabel("$PBS_MARQUEE", 104, 88, 91, 17) $Label3 = GUICtrlCreateLabel("$PBS_MARQUEE+$PBS_SMOOTH+$PBS_VERTICAL", 32, 280, 268, 17) $Progress4 = GUICtrlCreateProgress(32, 0, 25, 265, BitOR($PBS_VERTICAL,$PBS_MARQUEE)) $Progress5 = GUICtrlCreateProgress(104, 112, 289, 25, $PBS_SMOOTH) $Label4 = GUICtrlCreateLabel("$PBS_SMOOTH", 104, 144, 84, 17) $Progress6 = GUICtrlCreateProgress(104, 162, 289, 25, BitOR($PBS_SMOOTH,$PBS_MARQUEE)) $Label5 = GUICtrlCreateLabel("$PBS_MARQUEE+$PBS_SMOOTH", 104, 194, 177, 17) $Label6 = GUICtrlCreateLabel("$PBS_MARQUEE+$PBS_VERTICAL", 64, 248, 182, 17) $Progress7 = GUICtrlCreateProgress(64, 0, 25, 233, $PBS_VERTICAL) $Label7 = GUICtrlCreateLabel("$PBS_VERTICAL", 92, 220, 89, 17) GUISetState() AdlibEnable("Advance", 50) ; Loop until user exits do until GUIGetMsg() = $GUI_EVENT_CLOSE Func Advance() $i=$i+1 GUICtrlSetData($Progress1, $i) GUICtrlSetData($Progress2, $i) GUICtrlSetData($Progress3, $i) GUICtrlSetData($Progress4, $i) GUICtrlSetData($Progress5, $i) GUICtrlSetData($Progress6, $i) GUICtrlSetData($Progress7, $i) If $i = 100 Then $i = 0 EndFunc Edited September 13, 2007 by CyberZeroCool [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
smashly Posted September 13, 2007 Share Posted September 13, 2007 Nice demo , thank you, You might want to mention that theses styles will not override windows xp default theme of progress bar unless in classic mode.. Cheers Link to comment Share on other sites More sharing options...
gseller Posted September 13, 2007 Share Posted September 13, 2007 I like, these are very smooth, not flickering that I could see. Thanx.. Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 13, 2007 Author Share Posted September 13, 2007 (edited) Nice demo , thank you,You might want to mention that theses styles will not override windows xp default theme of progress bar unless in classic mode..CheersThanks guys.The only one that doesn't work for me in XP theme is the Smooth. Everything else works just fine in both Edited September 13, 2007 by CyberZeroCool [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
Siao Posted September 13, 2007 Share Posted September 13, 2007 (edited) The only one that doesn't work for me in XP theme is the Smooth.It appears that this problem is easily fixable. Just add DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", "", "wstr", "") after you create a progress bar. Good thing with classic look is that setting color and background color works too Default blue on gray looks boring. Edited September 13, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Valuater Posted September 13, 2007 Share Posted September 13, 2007 Maybe... From Autoit wrappers and your gui expandcollapse popup#include <GuiConstants.au3> #include <GUIConstants.au3> ;Global Const $PBS_SMOOTH = 0x00000001 ; The progress bar displays progress status in a smooth scrolling bar ;Global Const $PBS_VERTICAL = 0x00000004 ; The progress bar displays progress status vertically Global Const $PBS_MARQUEE = 0x00000008 ; The progress bar moves like a marquee Global $i=0, $XS_n ; Create GUI $Form1 = GUICreate("Progress Demo By CyberZeroCool", 401, 301, 341, 258) XPStyle() $Progress1 = GUICtrlCreateProgress(0, 0, 25, 297, BitOR($PBS_SMOOTH,$PBS_VERTICAL,$PBS_MARQUEE)) $Progress2 = GUICtrlCreateProgress(104, 0, 289, 25) $Progress3 = GUICtrlCreateProgress(104, 56, 289, 25, $PBS_MARQUEE) $Label1 = GUICtrlCreateLabel("-1 (NO STYLE)", 104, 32, 75, 17) $Label2 = GUICtrlCreateLabel("$PBS_MARQUEE", 104, 88, 91, 17) $Label3 = GUICtrlCreateLabel("$PBS_MARQUEE+$PBS_SMOOTH+$PBS_VERTICAL", 32, 280, 268, 17) $Progress4 = GUICtrlCreateProgress(32, 0, 25, 265, BitOR($PBS_VERTICAL,$PBS_MARQUEE)) $Progress5 = GUICtrlCreateProgress(104, 112, 289, 25, $PBS_SMOOTH) $Label4 = GUICtrlCreateLabel("$PBS_SMOOTH", 104, 144, 84, 17) $Progress6 = GUICtrlCreateProgress(104, 162, 289, 25, BitOR($PBS_SMOOTH,$PBS_MARQUEE)) $Label5 = GUICtrlCreateLabel("$PBS_MARQUEE+$PBS_SMOOTH", 104, 194, 177, 17) $Label6 = GUICtrlCreateLabel("$PBS_MARQUEE+$PBS_VERTICAL", 64, 248, 182, 17) $Progress7 = GUICtrlCreateProgress(64, 0, 25, 233, $PBS_VERTICAL) $Label7 = GUICtrlCreateLabel("$PBS_VERTICAL", 92, 220, 89, 17) XPStyle(0) GUISetState() AdlibEnable("Advance", 50) ; Loop until user exits do until GUIGetMsg() = $GUI_EVENT_CLOSE Func Advance() $i=$i+1 GUICtrlSetData($Progress1, $i) GUICtrlSetData($Progress2, $i) GUICtrlSetData($Progress3, $i) GUICtrlSetData($Progress4, $i) GUICtrlSetData($Progress5, $i) GUICtrlSetData($Progress6, $i) GUICtrlSetData($Progress7, $i) If $i = 100 Then $i = 0 EndFunc Func XPStyle($OnOff = 1) If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc ;==>XPStyle 8) Link to comment Share on other sites More sharing options...
MCP Posted September 13, 2007 Share Posted September 13, 2007 This may be very helpful to understanding the different types of progress bars that you can easily add into your projects.Yes, indeed. Thanks a lot Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 13, 2007 Author Share Posted September 13, 2007 Yes, indeed. Thanks a lot Thanks guys, it shure did help me. I love the $PBS_MARQUEE+$PBS_SMOOTH one, its great for when you don't know when somethings going to finish. [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] 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