返回子月历控件句柄
#Include <GuiDateTimePicker.au3>
_GUICtrlDTP_GetMonthCal($hWnd)
$hWnd | 控件句柄 |
#include <GUIConstantsEx.au3>
#include <GuiDateTimePicker.au3>
$Debug_DTP = False ; 检查传递给 DTP 函数的类名, 设置为真并使用另一控件的句柄可以看出它是否有效
Global $iMemo
_Main()
Func _Main()
Local $hGui, $hDTP
; 创建 GUI
$hGui = GUICreate("DateTimePick Get Month Calendar Child Handle", 400, 300)
$hDTP = _GUICtrlDTP_Create($hGui, 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")
; 获取月历控件子句柄
GUICtrlSetData($iMemo, "MonthCal child Handle: " & "0x" & Hex(_GUICtrlDTP_GetMonthCal($hDTP)), 1)
GUICtrlSetData($iMemo, " IsPtr=" & IsPtr(_GUICtrlDTP_GetMonthCal($hDTP)), 1)
GUICtrlSetData($iMemo, " IsHwnd=" & IsHWnd(_GUICtrlDTP_GetMonthCal($hDTP)) & @CRLF, 1)
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main