Function Reference


_GUICtrlStatusBar_SetBkColor

Sets the background color

#include <GuiStatusBar.au3>
_GUICtrlStatusBar_SetBkColor ( $hWnd, $iColor )

Parameters

$hWnd Handle to the control
$iColor New background color. Specify the CLR_DEFAULT value to cause the status bar to use its default background color.

Return Value

Returns the previous background color, or CLR_DEFAULT if the background color is the default color.

Remarks

Returns RGB COLORREF color, color passed in must be BGR Hex color or RGB COLORREF

StatusBar controls cannot be painted if the "Windows XP style" is used. Some themes also prevent the statusbar from colouring - if the function appears not to work try removing the theme using _WinAPI_SetWindowTheme() with empty strings for the parameters.

Example

#include <ColorConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <MsgBoxConstants.au3>
#include <WinAPI.au3>

Example()

Func Example()
    Local $hGUI, $hStatus
    Local $aParts[3] = [75, 150, -1]

    ; Create GUI
    $hGUI = GUICreate("StatusBar Set BkColor", 400, 300)
    $hStatus = _GUICtrlStatusBar_Create($hGUI)
    GUISetState(@SW_SHOW)

    ; Set parts
    _GUICtrlStatusBar_SetParts($hStatus, $aParts)
    _GUICtrlStatusBar_SetText($hStatus, "Part 1")
    _GUICtrlStatusBar_SetText($hStatus, "Part 2", 1)

    ; Set background color
    _GUICtrlStatusBar_SetBkColor($hStatus, $CLR_MONEYGREEN)

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example