Jump to content
Sign in to follow this  
leegold

GUICtrlCreateDate Code Question.

Recommended Posts

leegold

Hi,

I want to have it look a little like example 3 in the function documentation, but slightly customize it.

For GUICtrlCreateDate documentation example3 theres code I don't understand. So looking at example 3 theres "$DTM_SETFORMAT_ = 0x1032 ;" what is this doing? What the "0x1032" doing? Heres the function. Thanks very much:

 

; example3
Func Example3()
    Local $date, $DTM_SETFORMAT_, $style

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)

    ; to select a specific default format
    $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW
    $style = "yyyy/MM/dd HH:mm:ss"
    GUICtrlSendMsg($date, $DTM_SETFORMAT_, 0, $style)

    GUISetState()
    While GUIGetMsg() <> $GUI_EVENT_CLOSE
    WEnd

    MsgBox(0, "Time", GUICtrlRead($date))
EndFunc   ;==>Example3

Share this post


Link to post
Share on other sites
water

According to the help file this is the message type being sent to the control: "type of message to be send to the control as defined in the Windows control documentation."


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
zaNergal

Look in the file includesDateTimeConstants.au3 for a list of messages that can be passed to the DateTimePicker.

Setting the Date Format in ASCII would be 0x1005, and setting the date in Unicode 0x1032 (0x1000 + 50)

Global Const $DTM_FIRST = 0x1000
Global Const $DTM_SETFORMAT = $DTM_FIRST + 5
Global Const $DTM_SETFORMATW = $DTM_FIRST + 50 ; [Unicode]

Other messages you can send include setting the color, setting the font and so forth.

 

Share this post


Link to post
Share on other sites
leegold

Many Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×