PowerBASIC Peer Support Forums
 

Go Back   PowerBASIC Peer Support Forums > User to user Discussions > PowerBASIC for Windows

PowerBASIC for Windows User to user discussions about the PB/Win (formerly PB/DLL) product line. Discussion topics include PowerBASIC Forms, PowerGEN and PowerTree for Windows.

Reply
 
Thread Tools Display Modes
  #1  
Old May 11th, 2013, 05:52 PM
Trento Castricone Trento Castricone is offline
Member
 
Join Date: Nov 2002
Location: Maryland, USA
Posts: 465
Sysdatetimepick32

I use the control "SYSDATETIMEPICK32" in an application many times.
The default format for the ShortDate is "M/d/yyyy" - "5/11/2013".
Depending on my needs, I format the date returned many different ways.

In the control panel - "Region and Language" there are seven(7) different ShortDate formats all of which can become the default.
(According to Microsoft - changed manually only by the user.)

Before I write a routine to accommodate all seven of these ShortDate formats, does anyone using the above control have a work around or suggestion?
__________________
Trento Castricone
www.raineyday.com
trento@raineyday.com
Reply With Quote
  #2  
Old May 11th, 2013, 06:06 PM
Michael Mattias Michael Mattias is offline
Member
 
Join Date: Aug 1998
Location: Racine WI USA
Posts: 36,918
The DTM_SETFORMAT message looks promising.

And you would not care which format the user is using... since you only interact with the control by means of a SYSTEMTIME structure.
Reply With Quote
  #3  
Old May 11th, 2013, 08:17 PM
Trento Castricone Trento Castricone is offline
Member
 
Join Date: Nov 2002
Location: Maryland, USA
Posts: 465
Thanks Michael

Works!

Code:
           LOCAL dDateFormat AS WSTRINGZ * %MAX_PATH
           LOCAL SYSDATETIMEPICK32_HANDLE1 AS LONG
           LOCAL SYSDATETIMEPICK32_HANDLE2 AS LONG
           CONTROL HANDLE ghDlg, %IDC_SYSDATETIMEPICK32_1 TO  SYSDATETIMEPICK32_HANDLE1
           CONTROL HANDLE ghDlg, %IDC_SYSDATETIMEPICK32_2 TO  SYSDATETIMEPICK32_HANDLE2
           '
           dDateFormat = "M/d/yyyy"
           SendMessageW(SYSDATETIMEPICK32_HANDLE1, %DTM_SETFORMATW, 0, VARPTR(dDateFormat))
           SendMessageW(SYSDATETIMEPICK32_HANDLE2, %DTM_SETFORMATW, 0, VARPTR(dDateFormat))
__________________
Trento Castricone
www.raineyday.com
trento@raineyday.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:15 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1999-2011 PowerBASIC, Inc. All Rights Reserved.
Error in my_thread_global_end(): 1 threads didn't exit