Function Reference


Retrieves a given color for the control

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


$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.




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

Global $g_idMemo


Func Example()
    ; Create GUI
    GUICreate("Month Calendar Get Color", 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")

    ; Get/Set calendar color
    MemoWrite("Background: 0x" & Hex(_GUICtrlMonthCal_GetColor($idMonthCal, $MCSC_MONTHBK), 6))
    ; _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_MONTHBK, $CLR_MONEYGREEN)
    _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.
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example

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