UnReAl Posted February 14, 2008 Share Posted February 14, 2008 Hi allI wanted to create a red progressbar using the $PBS_SMOOTH style. If i read the help file i found this: (from autoitv3.chm)Only Button, Label, Checkbox, Group, Radio, Edit, Input, List, Listview, ListviewItem, Treeview, TreeviewItem, Graphic and Progress controls can currently be colored.Checkbox, Radio or cannot be painted if the "Windows XP style" is used.The $PBS_SMOOTH style and painting the progressbar don`t works with the Win XP style,but i don`t want to change the style of my computer everytime i run this programm!Can i do something so that only the gui is using win98 style? Link to comment Share on other sites More sharing options...
Valuater Posted February 14, 2008 Share Posted February 14, 2008 Like thisexpandcollapse popup#include <GUIConstants.au3> Dim $XS_n GUICreate("My GUI Progressbar",220,100, 100,200) XPStyle(1) $progressbar1 = GUICtrlCreateProgress (10,10,200,20) GUICtrlSetColor(-1,32250); not working with Windows XP Style $progressbar2 = GUICtrlCreateProgress (10,40,200,20,$PBS_SMOOTH) $button = GUICtrlCreateButton ("Start",75,70,70,20) XPStyle(0) GUISetState () $wait = 20; wait 20ms for next progressstep $s = 0; progressbar-saveposition do $msg = GUIGetMsg() If $msg = $button Then GUICtrlSetData ($button,"Stop") For $i = $s To 100 If GUICtrlRead($progressbar1) = 50 Then Msgbox(0,"Info","The half is done...", 1) $m = GUIGetMsg () If $m = -3 Then ExitLoop If $m = $button Then GUICtrlSetData ($button,"Next") $s = $i;save the current bar-position to $s ExitLoop Else $s=0 GUICtrlSetData ($progressbar1,$i) GUICtrlSetData ($progressbar2,(100 - $i)) Sleep($wait) EndIf Next if $i >100 then ; $s=0 GUICtrlSetData ($button,"Start") endif EndIf until $msg = $GUI_EVENT_CLOSE 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 ;==>XPStylethere are more helpful "scriplets" in Autoit Wrappers located here....http://www.autoitscript.com/forum/index.ph...st&p=1337698) Link to comment Share on other sites More sharing options...
UnReAl Posted February 14, 2008 Author Share Posted February 14, 2008 Thx for your fast help Link to comment Share on other sites More sharing options...
Valuater Posted February 14, 2008 Share Posted February 14, 2008 Thx for your fast help Welcome!8) Link to comment Share on other sites More sharing options...
Aceguy Posted February 15, 2008 Share Posted February 15, 2008 DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ") [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock 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