Jump to content

Win8 ProgressBar Options cant be set? (Like Color)


cburak
 Share

Go to solution Solved by UEZ,

Recommended Posts

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 by cburak
Link to comment
Share on other sites

  • Solution

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...