Retrieves the minimum size required to display a full month in a month calendar control
#include <GuiMonthCal.au3>
_GUICtrlMonthCal_GetMinReqRectArray ( $hWnd )
$hWnd | Control ID/Handle to the control |
Success: | an array with the following format: [0] - Count [1] - X coordinate of the upper left corner of the rectangle [2] - Y coordinate of the upper left corner of the rectangle [3] - X coordinate of the lower right corner of the rectangle [4] - Y coordinate of the lower right corner of the rectangle |
Failure: | sets the @error flag to non-zero. |
The minimum required window size for a month calendar control depends on the currently selected font, control styles, system metrics, and regional settings.
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiMonthCal.au3>
#include <WindowsConstants.au3>
Global $g_idMemo
Example()
Func Example()
Local $idMonthCal
; Create GUI
GUICreate("Month Calendar Get Min Req Rect Array", 400, 300)
$idMonthCal = GUICtrlCreateMonthCal("", 4, 4, -1, -1, BitOR($WS_BORDER, $MCS_MULTISELECT), 0x00000000)
; Create memo control
$g_idMemo = GUICtrlCreateEdit("", 4, 168, 392, 128, BitOR($WS_VSCROLL, $ES_MULTILINE))
GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
GUICtrlSendMsg($g_idMemo, $EM_SETREADONLY, True, 0)
GUICtrlSetBkColor($g_idMemo, 0xFFFFFF)
GUISetState(@SW_SHOW)
; Get minimum required height/width
MemoWrite(_FormatOutPut(_GUICtrlMonthCal_GetMinReqRectArray($idMonthCal)))
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example
Func _FormatOutPut($aRect)
Return "Minimum required Width: " & @TAB & $aRect[3] & @CRLF & "Minimum required Height:" & @TAB & $aRect[4]
EndFunc ;==>_FormatOutPut
; Write message to memo
Func MemoWrite($sMessage)
GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite