d3mon Posted July 21, 2008 Share Posted July 21, 2008 I've tried to change progress color with GuiCtrlSetColor() and GuiCtrlSetBkColor() with no succes so I want to know if it's possible to change color without put image or another thing... Thanks for anyhelp ! No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE Link to comment Share on other sites More sharing options...
JFee Posted July 21, 2008 Share Posted July 21, 2008 From the helpfile:Only Button, Label, Checkbox, Group, Radio, Edit, Input, List, Listview, ListviewItem, Treeview, TreeviewItem, Graphic and Progress controls can currently be colored.Checkbox, Radio or Progress controls cannot be painted if the "Windows XP style" is used. Regards,Josh Link to comment Share on other sites More sharing options...
d3mon Posted July 21, 2008 Author Share Posted July 21, 2008 From the helpfile:I know that i answer for other possibility No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE Link to comment Share on other sites More sharing options...
JFee Posted July 21, 2008 Share Posted July 21, 2008 My bad, I thought it was referring to a WS_EX style muttley Regards,Josh Link to comment Share on other sites More sharing options...
Szhlopp Posted July 21, 2008 Share Posted July 21, 2008 I've tried to change progress color with GuiCtrlSetColor() and GuiCtrlSetBkColor() with no succes so I want to know if it's possible to change color without put image or another thing... Thanks for anyhelp ! Teehee expandcollapse popup#include <GUIConstants.au3> $Form1 = GUICreate("Form1", 625, 445, 193, 125) $Progress1 = GUICtrlCreateProgress(100, 100, 400, 50) _GuiCtrlMakeTrans(-1, 80) GUICtrlSetData(-1, 50) $label1 = GUICtrlCreateLabel("", 100, 100, 200, 50) GUICtrlSetState(-1, $GUI_ONTOP) GUICtrlSetBkColor(-1, 0xFF0000) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _GuiCtrlMakeTrans($iCtrlID,$iTrans=255) Local $pHwnd, $nHwnd, $aPos, $a $hWnd = GUICtrlGetHandle($iCtrlID);Get the control handle If $hWnd = 0 then Return SetError(1,1,0) $pHwnd = DllCall("User32.dll", "hwnd", "GetParent", "hwnd", $hWnd);Get the parent Gui Handle If $pHwnd[0] = 0 then Return SetError(1,2,0) $aPos = ControlGetPos($pHwnd[0],"",$hWnd);Get the current pos of the control If @error then Return SetError(1,3,0) $nHwnd = GUICreate("", $aPos[2], $aPos[3], $aPos[0], $aPos[1], 0x80000000, 0x00080000 + 0x00000040, $pHwnd[0]);greate a gui in the position of the control If $nHwnd = 0 then Return SetError(1,4,0) $a = DllCall("User32.dll", "hwnd", "SetParent", "hwnd", $hWnd, "hwnd", $nHwnd);change the parent of the control to the new gui If $a[0] = 0 then Return SetError(1,5,0) If NOT ControlMove($nHwnd,'',$hWnd,0,0) then Return SetError(1,6,-1);Move the control to 0,0 of the newly created child gui GUISetState(@SW_Show,$nHwnd);show the new child gui WinSetTrans($nHwnd,"",$iTrans);set the transparency If @error then Return SetError(1,7,0) GUISwitch($pHwnd[0]);switch back to the parent Gui Return $nHwnd;Return the handle for the new Child gui EndFunc RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Linux Posted July 21, 2008 Share Posted July 21, 2008 Hi! I assume you are using windows XP. Use this at the start of your script to enable colors in the progressbars. ; ==================== Function XPStyleToggle ============= ; This function will disable the XP Style, so that Autoit can draw the progressbar in smooth, and with colors. Func XPStyleToggle($OnOff = 1) If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0 If $OnOff Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc ;==>XPStyleToggle You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!" Link to comment Share on other sites More sharing options...
d3mon Posted July 22, 2008 Author Share Posted July 22, 2008 Hi! I assume you are using windows XP. Use this at the start of your script to enable colors in the progressbars. ; ==================== Function XPStyleToggle ============= ; This function will disable the XP Style, so that Autoit can draw the progressbar in smooth, and with colors. Func XPStyleToggle($OnOff = 1) If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0 If $OnOff Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc ;==>XPStyleToggle Thanks but how can I change color because progress are bleue and when I make GUICtrlSetColor(-1,0x000000) nothing happend its normal ? No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE 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