Function Reference


_GUICtrlMonthCal_GetColor

Retrieves a given color for the control

#include <GuiMonthCal.au3>
_GUICtrlMonthCal_GetColor ( $hWnd, $iIndex )

Parameters

$hWnd Control ID/Handle to the control
$iIndex Indicates which month calendar color to retrieve:
    $MCSC_BACKGROUND - Background color displayed between months
    $MCSC_TEXT - Color used to display text within a month
    $MCSC_TITLEBK - Background color displayed in the calendar title
    $MCSC_TITLETEXT - Color used to display text within the calendar title
    $MCSC_MONTHBK - Background color displayed within the month
    $MCSC_TRAILINGTEXT - Color used to display header day and trailing day text

Return Value

Success: the indicated color.
Failure: -1.

Related

_GUICtrlMonthCal_SetColor

Example

#include <GUIConstantsEx.au3>
#include <GuiMonthCal.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>

Global $g_idMemo

Example()

Func Example()
        ; Create GUI
        GUICreate("Month Calendar Get/Set Color (v" & @AutoItVersion & ")", 400, 300)
        Local $idMonthCal = GUICtrlCreateMonthCal("", 4, 4, -1, -1, $WS_BORDER, 0x00000000)

        ; Create memo control
        $g_idMemo = GUICtrlCreateEdit("", 4, 188, 392, 108, 0)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUISetState(@SW_SHOW)

        ; Get/Set calendar color
        MemoWrite("Background: 0x" & Hex(_GUICtrlMonthCal_GetColor($idMonthCal, $MCSC_MONTHBK), 6))
        _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_TEXT, 0xB02B00)
        _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_TITLEBK, 0x5EFFFE)
        _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_TITLETEXT, 0x0000FF)
        _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_MONTHBK, 0x87C4FF)
        _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_TRAILINGTEXT, 0x997777)
        MemoWrite("Background: 0x" & Hex(_GUICtrlMonthCal_GetColor($idMonthCal, $MCSC_MONTHBK), 6))

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

; Write message to memo
Func MemoWrite($sMessage)
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite