NO

Author Topic: DATETIMEPICK_CLASS pre-load  (Read 3428 times)

tpekar

  • Guest
DATETIMEPICK_CLASS pre-load
« on: July 08, 2014, 04:12:19 PM »
I am trying to load a DATETIMEPICK_CLASS control with my own default date but it keeps replacing it with today's date.  Is there a way to keep it from doing that?  Thanks in advance.

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: DATETIMEPICK_CLASS pre-load
« Reply #1 on: July 08, 2014, 07:48:32 PM »
In line 44, right under "WM_CREATE", put the DTM_SETSYSTEMTIME message.

JohnF

  • Guest
Re: DATETIMEPICK_CLASS pre-load
« Reply #2 on: July 08, 2014, 08:35:47 PM »
This seems to work but it was not clear which macro to use at first.

Code: [Select]
SYSTEMTIME st;
GetSystemTime(&st);
st.wYear = 2000; // set any
st.wMonth = 2;
st.wDay   = 3;

MonthCal_SetCurSel(hwndCal, &st);


John

JohnF

  • Guest
Re: DATETIMEPICK_CLASS pre-load
« Reply #3 on: July 09, 2014, 06:02:34 PM »
tpekar,

You can also turn off the today stuff at the bottom. Use the style MCS_NOTODAY when creating the control.

John

tpekar

  • Guest
Re: DATETIMEPICK_CLASS pre-load
« Reply #4 on: July 11, 2014, 04:18:48 PM »
Thanks JohnF.  That worked.