cburak Posted October 18, 2013 Share Posted October 18, 2013 (edited) I cant costumise any progressbar in a gui with using 'guictrlsetcolor' or 'guictrlsetdefbkcolor'. I wonder if anyone here using Win8 and having some problem.(or Win7) Example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> guicreate("",200,200,600,800) $p1=GUICtrlCreateProgress(20,20,100,20) $l1=GUICtrlCreateLabel("",40,60,30,40) GUICtrlSetColor(-1,0xff0000) GUISetState() HotKeySet("x","Progress") While 1 Sleep(200) WEnd Func Progress() For $i=1 to 100 GUICtrlSetData($p1,$i) GUICtrlSetData($l1,$i) sleep(10) Next EndFunc I get default greenbar with those codes. Also $PBS_SMOOTH is make no difference either. (its on by default and cant set off I guess). If you say 'its Win8 issue' or 'Win8 wont let you to change those things' then its ok. just wondering if there is a way to override default theme color. Thank you. Any help is much appreciated. Edit: Also progressbar reachs %100 later then $i (about 1seconds later). I dont know why. Window8 64bit Edited October 18, 2013 by cburak Link to comment Share on other sites More sharing options...
Solution UEZ Posted October 18, 2013 Solution Share Posted October 18, 2013 Use this to change color: $p1=GUICtrlCreateProgress(20,20,100,20) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($p1), "wstr", 0, "wstr", 0) GUICtrlSetColor(-1, 0x0000FF) Br, UEZ cburak 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
cburak Posted October 19, 2013 Author Share Posted October 19, 2013 Use this to change color: $p1=GUICtrlCreateProgress(20,20,100,20) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($p1), "wstr", 0, "wstr", 0) GUICtrlSetColor(-1, 0x0000FF) Br, UEZ Thank you! Thats a great way to do it. Also I have learn that: DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) is totaly disables the current theme. Then I can create all my progressbars. but later do you know how can I enable the current theme back? Thanks again. Note: Nice signature:D Link to comment Share on other sites More sharing options...
UEZ Posted October 19, 2013 Share Posted October 19, 2013 Try this: $aSave = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) ... DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $aSave[0]) Br, UEZ cburak 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
cburak Posted October 19, 2013 Author Share Posted October 19, 2013 Try this: $aSave = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) ... DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $aSave[0]) Br, UEZ Again amazing idea .. Çok sağol.. Link to comment Share on other sites More sharing options...
UEZ Posted October 19, 2013 Share Posted October 19, 2013 Rica ederim. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ 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