找回密码
 加入
搜索
查看: 2005|回复: 2

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

[复制链接]
发表于 2009-6-15 21:45:24 | 显示全部楼层 |阅读模式
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
时间不见了,,想了解下。这个值是如果取的。如果计算的??
发表于 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   
效果图:(时间会自动跳动显示)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

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

再问下。。哪里有没有好点的学习使用、查询MSND 的教程这类的东东??
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-23 01:24 , Processed in 0.076536 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表