月カレンダーのフォントハンドルを取得します。
#Include <GuiDateTimePicker.au3>
_GUICtrlDTP_GetMCFont($hWnd)
パラメータ
$hWnd | コントロールのハンドル |
返し値
成功: | フォントハンドル |
失敗: | 0 |
注意
なし。
関連
_GUICtrlDTP_SetMCFont
例
#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiDateTimePicker.au3>
Opt('MustDeclareVars', 1)
$Debug_DTP = False ; DTP関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用
Global $iMemo
_Main()
Func _Main()
Local $tLOGFONT, $hFont, $hDTP
; GUIを作成
GUICreate("DateTimePick Get 月 Calendar Font", 400, 300)
$hDTP = GUICtrlGetHandle(GUICtrlCreateDate("", 2, 6, 190))
$iMemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; 表示形式を設定
_GUICtrlDTP_SetFormat($hDTP, "ddd MMM dd, yyyy hh:mm ttt")
; 月コントロール用の新しいフォントを作成
$tLOGFONT = DllStructCreate($tagLOGFONT)
DllStructSetData($tLOGFONT, "Height", 13)
DllStructSetData($tLOGFONT, "Weight", 400)
DllStructSetData($tLOGFONT, "FaceName", "Verdana")
$hFont = _WinAPI_CreateFontIndirect($tLOGFONT)
_GUICtrlDTP_SetMCFont($hDTP, $hFont)
; 月コントロールのフォントハンドルを取得
GUICtrlSetData($iMemo, "Font Handle: " & "0x" & Hex(_GUICtrlDTP_GetMCFont($hDTP), 6) & @CRLF, 1)
; ユーザーが終了するまでループ
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
; メモコントロールに1行書き込み
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite