-
April 17th, 2013, 09:29 PM
#1
Getting date to SYSTEMTIME from DATETIMEPICK_CLASS control
Hey ho!
It's been more than a week since i got stuck with one small stupid thing and i cannot move forward with the code.
I've created a static dialog (IDD_FVT DIALOGEX 0, 0, 319, 200) with a control as follows:
CONTROL "", IDC_FVT_dwst, DATETIMEPICK_CLASS, WS_TABSTOP | DTS_RIGHTALIGN, 219, 25, 55, 13
What i need to do now is to let the user pick the date and when he/she clicks "save" i need to be able to use that date. By the following function i'm getting the handle to this control:
HWND FVT_dwst = GetDlgItem( hwnd, IDC_FVT_dwst )
Now, having HWND FVT_dwst, how can i use the date, how can i get it from that control and which format (structure) it would be so i can then use it in my program?
I believe it should be something like SYSTEMTIME but still don't know how to get it from that **** control.
I am really desperate so i'd be very grateful for any kind of hint.
Microsoft does not say anything about this. They only say how to create or modify the DTPicker.
thanks
berkov
-
April 18th, 2013, 03:31 AM
#2
Re: Getting date to SYSTEMTIME from DATETIMEPICK_CLASS control
Originally Posted by berkov
Microsoft does not say anything about this. They only say how to create or modify the DTPicker.
Microsoft does say about Using Date and Time Picker Controls in MSDN.
What you need is reading about How to Process Date and Time Picker Notifications
And the notification you currently need to is DTN_DATETIMECHANGE
Victor Nijegorodov
-
April 18th, 2013, 12:32 PM
#3
Re: Getting date to SYSTEMTIME from DATETIMEPICK_CLASS control
Best regards,
Igor
-
April 19th, 2013, 02:13 AM
#4
Re: Getting date to SYSTEMTIME from DATETIMEPICK_CLASS control
Works perfectly!
thanks a lot.
i guess i need to spend some more time on MSDN to work out how to use it better.
bool Control2Date(HWND control, SYSTEMTIME * target){
SendMessage(control, DTM_GETSYSTEMTIME, 0, (LPARAM) target);
return true;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|