Sign in to follow this  
Followers 0
leegold

GUICtrlCreateDate Code Question.

4 posts in this topic

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



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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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

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  
Followers 0