sinie 发表于 2009-6-15 21:45:24

请问高手解释一下 $DTM_SETFORMAT_ = 0x1032 中是 0x1032 是如何取值的?

Func Example1()
        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

请问高手解释一下 $DTM_SETFORMAT_ = 0x1032 中是 0x1032 是如何取值的?
0x1032日期效果格式为 yyyy/MM/dd HH:mm:ss
改为任意值0x* 日期效果格式为 yyyy/MM/dd
时间不见了,,想了解下。这个值是如果取的。如果计算的??

lynfr8 发表于 2009-6-15 22:29:53

本帖最后由 lynfr8 于 2009-6-15 22:32 编辑

应该是一个已定义好的常量,不是计算出来的
http://msdn.microsoft.com/en-us/library/aa921603.aspx#Mtps_DropDownFilterText
帮助文件出现过的就两个
$DTM_SETFORMAT_ = 0x1032   
$DTM_SETFORMAT = 0x1005
另外,Pcbar写过公历转农历的一个实例也用过
http://www.autoitx.com/forum.php?mod=viewthread&tid=2646
不过没怎么研究过
另外,附一个类似的例子,不过比那个帮助文件的演示更能学多一点#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
main()
Func main()
    Local $date, $msg, $DTM_SETFORMAT_, $style, $begin, $dif
    GUICreate("TopMost Clock", 200, 40, 800, 200, -1, $WS_EX_TOPMOST)
    $date = GUICtrlCreateDate("", 10, 10, 185, 20)
    If @Unicode Then
      $DTM_SETFORMAT_ = 0x1032
    Else
      $DTM_SETFORMAT_ = 0x1005
    EndIf
    $style = "yyyy/MM/dd HH:mm:s"
    GUICtrlSendMsg($date, $DTM_SETFORMAT_, 0, $style)
    GUISetState()
    $begin=TimerInit()
    While GUIGetMsg() <> $GUI_EVENT_CLOSE
      $dif = TimerDiff($begin)
      If $dif>1000 Then
            $begin=TimerInit()
            GUICtrlSetData($date,"")
      EndIf
    WEnd
EndFunc   
效果图:(时间会自动跳动显示)

sinie 发表于 2009-6-16 15:06:21

感谢这位帅哥给得回复,偶是新手,MSND 好象没说怎么定义呢??0x1032 在哪查询这些定义呢?
Pcbar写过公历转农历的一个实例 有点深了。。我暂时还看不懂。。呵。可能你也没研究过这个,解决不了也没事。。至少我懂得这东东是怎么来的就是了。。。以后有用到这个只能套用先喽。,

再问下。。哪里有没有好点的学习使用、查询MSND 的教程这类的东东??
页: [1]
查看完整版本: 请问高手解释一下 $DTM_SETFORMAT_ = 0x1032 中是 0x1032 是如何取值的?