The MASM Forum Archive 2004 to 2012

Project Support Forums => IDE Development and Support => Easy Code => Topic started by: Loneguy on January 28, 2011, 10:55:08 AM

Title: DateTime Control
Post by: Loneguy on January 28, 2011, 10:55:08 AM
Hello,

How do I set the date when using the DateTime control? I used this:

                                   Invoke SetDlgItemText, hDlg, DateTimeHandle, Addr Date

but it does not work...... :-(

Could anyone help me?
Title: Re: DateTime Control
Post by: fearless on January 28, 2011, 11:35:53 AM
Using Date and Time Picker Controls: http://msdn.microsoft.com/en-us/library/bb761815%28VS.85%29.aspx

To set the date it must be be a valid SYSTEMTIME structure, which you can use with DTM_SETSYSTEMTIME message: http://msdn.microsoft.com/en-us/library/bb761782%28v=VS.85%29.aspx

Invoke SendMessage, DateTimeHandle, DTM_SETSYSTEMTIME, GDT_VALID, Addr DateValueToSet

DateValueToSet in example would need to be a SYSTEMTIME variable: http://msdn.microsoft.com/en-us/library/ms724950%28v=VS.85%29.aspx
Title: Re: DateTime Control
Post by: Loneguy on January 29, 2011, 11:14:38 AM
It works fine. Thank you very much.