jonny1234 Posted May 8, 2007 Share Posted May 8, 2007 Hi, When I run the following date control example from the help file using AutoIt 3.2.3.14, the date does not display in the specified format. On my PC, it just shows "1953" in the date control. #include <GUIConstants.au3> 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 = 0x1005 $style = "yyyy/MM/dd HH:mm:s" GuiCtrlSendMsg($date, $DTM_SETFORMAT, 0, $style) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox(0,"Time", GUICtrlRead($date)) Does anyone else have the same problem? Regards, Jonny Link to comment Share on other sites More sharing options...
jonny1234 Posted May 9, 2007 Author Share Posted May 9, 2007 I have just tried the help file example with the latest beta (v3.2.4.0), and the same thing happens. Please could someone test this. Thanks. Regards, Jonny Link to comment Share on other sites More sharing options...
i542 Posted May 9, 2007 Share Posted May 9, 2007 Works fine at my. I have Win 2000. i542 I can do signature me. Link to comment Share on other sites More sharing options...
jonny1234 Posted May 9, 2007 Author Share Posted May 9, 2007 Works fine at my. I have Win 2000.i542Thanks for testing it.I am still having the problem on both Windows 2000 and Windows XP. It happened when I moved from AutoIt 3.2.3.2 to 3.2.3.14. If I go back to 3.2.3.2, the problem goes away.Regards,Jonny Link to comment Share on other sites More sharing options...
jonny1234 Posted May 9, 2007 Author Share Posted May 9, 2007 The problem is with GUICtrlSendMsg. If I send the $DTM_SETFORMAT message using DllCall and the SendMessage API function, then it works. Solution: #include <GUIConstants.au3> $form = 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 = 0x1005 $style = "yyyy/MM/dd HH:mm:s" DllCall("user32.dll", _ "int", "SendMessage", _ "hwnd", ControlGetHandle($form, "", $date), _ "int", $DTM_SETFORMAT, _ "int", 0, _ "str", $style) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd Regards, Jonny Link to comment Share on other sites More sharing options...
martin Posted May 12, 2007 Share Posted May 12, 2007 The problem is with GUICtrlSendMsg. If I send the $DTM_SETFORMAT message using DllCall and the SendMessage API function, then it works. Solution: #include <GUIConstants.au3> $form = 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 = 0x1005 $style = "yyyy/MM/dd HH:mm:s" DllCall("user32.dll", _ "int", "SendMessage", _ "hwnd", ControlGetHandle($form, "", $date), _ "int", $DTM_SETFORMAT, _ "int", 0, _ "str", $style) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd Regards, JonnyYes, looks like a bug. Have you tried reporting it? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Lord Maim Posted May 23, 2007 Share Posted May 23, 2007 I have this issue as well with 3.2.4.7 (and the new 3.2.4.8 released today) under Windows XP. Has this issue been reported yet? Link to comment Share on other sites More sharing options...
Holger Posted May 23, 2007 Share Posted May 23, 2007 As I wrote in the bug-forum. Use the unicode function value then you will be happy: #include <GUIConstants.au3> 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_SETFORMATW = 0x1032 $style = "yyyy/MM/dd HH:mm:s" GuiCtrlSendMsg($date, $DTM_SETFORMATW, 0, $style) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox(0,"Time", GUICtrlRead($date)) Maybe the most forgot that from beta version 3.2.3.3 on the default Autoit.exe is compiled in unicode... Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
Administrators Jon Posted May 25, 2007 Administrators Share Posted May 25, 2007 This works fine on unicode and ansi versions. #include <GUIConstants.au3> If @UNICODE Then const $DTM_SETFORMAT = 0x1032 Else const $DTM_SETFORMAT = 0x1005 Endif GUICreate ( "My GUI get date", 200,200,800,200) $date = GUICtrlCreateDate ("1953/04/25", 10,10,185,20 ) $style = "yyyy/MM/dd HH:mm:s" GuiCtrlSendMsg($date, $DTM_SETFORMAT, 0, $style) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox(0,"Time", GUICtrlRead($date)) Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now