Announcement

Collapse
No announcement yet.

Sysdatetimepick32

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.fileraptor.com
    trento@castricone.com

  • #2
    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.
    Michael Mattias
    Tal Systems Inc.
    Racine WI USA
    mailto:mmattias@talsystems.com
    www.talsystems.com

    Comment


    • #3
      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.fileraptor.com
      trento@castricone.com

      Comment

      Working...
      X