﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
2040	_GUICtrlDTP_SetRange; MinYear never goes below 1/1/1752 00:00:00	anonymous	Gary	"The minimum date never goes below 1/1/1752 00:00:00. What's weird is that it's 1 year behind the default limit. The help file does not mention any thing.

The default limit is 1/1/1753 00:00:00 according to:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.mindate.aspx
{{{
The minimum date and time that can be selected in the control. The default is 1/1/1753 00:00:00.
}}}

I'd like to get the minimum date at least 1/1/1601 00:00:00 as defined by FILETIME: 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724284%28v=vs.85%29.aspx
{{{
Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 
}}}


{{{
#include <ButtonConstants.au3>
#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiDateTimePicker.au3>

_Main()

Func _Main()

	Local $hGUI, $dtpDatePicker, $hDatePicker, $btnOK

	$hGUI = GUICreate(""GUICtrlCreateDate"", 266, 146, 310, 287)
	GUICtrlCreateGroup(""Date"", 24, 16, 217, 73)
	$dtpDatePicker = GUICtrlCreateDate("""", 40, 48, 186, 21)
	$hDatePicker = GUICtrlGetHandle($dtpDatePicker)
	; OR
;~ 	$hDatePicker = _GUICtrlDTP_Create($hGUI, 40, 48, 186, 21)

	GUICtrlCreateGroup("""", -99, -99, 1, 1)
	$btnOK = GUICtrlCreateButton(""OK"", 160, 104, 75, 25)

	Local $tDTPRange = DllStructCreate($tagDTPRANGE)
	DllStructSetData($tDTPRange, ""MinValid"", True)
    DllStructSetData($tDTPRange, ""MinYear"", 1601)
    DllStructSetData($tDTPRange, ""MinMonth"", 1)
    DllStructSetData($tDTPRange, ""MinDay"", 1)
	DllStructSetData($tDTPRange, ""MinHour"", 0)
    DllStructSetData($tDTPRange, ""MinMinute"", 0)
    DllStructSetData($tDTPRange, ""MinSecond"", 0)
    DllStructSetData($tDTPRange, ""MaxValid"", True)
    DllStructSetData($tDTPRange, ""MaxYear"", @YEAR)
    DllStructSetData($tDTPRange, ""MaxMonth"", @MON)
    DllStructSetData($tDTPRange, ""MaxDay"", @MDAY)
    DllStructSetData($tDTPRange, ""MaxHour"", 12)
    DllStructSetData($tDTPRange, ""MaxMinute"", 59)
    DllStructSetData($tDTPRange, ""MaxSecond"", 59)

	_GUICtrlDTP_SetRangeEx($hDatePicker, $tDTPRange)
	$tDTPRange = 0

	; Minimum date is set to 1/1/1601 00:00:00 as defined by FILETIME
	; - http://msdn.microsoft.com/en-us/library/windows/desktop/ms724284%28v=vs.85%29.aspx

	; The minimum date and time that can be selected in the control. The default is 1/1/1753 00:00:00.
	; - http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.mindate.aspx

	GUISetState(@SW_SHOW)

	While GUIGetMsg() <> $GUI_EVENT_CLOSE
	WEnd
EndFunc
}}}
"	Bug	closed		Standard UDFs	3.3.6.1	None	No Bug		
