Zaxon Posted November 21, 2007 Share Posted November 21, 2007 I've used code forever that changes the format of a date control, and although my script hasn't changed, a more recent version of AutoIt breaks the functionality. Currently using autoit-v3.2.9.11. I've written a test script by way of example: #include <GUIConstants.au3> GUICreate("") $date=GUICtrlCreateDate("",5,5,100,20,$dts_timeformat) $style = "hh:mm tt" ; or ;$style = "hh':'mm' 'tt" GuiCtrlSendMsg($date, $DTM_SETFORMAT, 0, $style) ; or ;GUICtrlSendMsg($date, 0x1005, 0, $style) GUISetState(@SW_SHOW) sleep(5000) This creates a time (date) control and attempts to change it's format to one which excludes the seconds. The two different format ($style = ) lines show testing attempts with the way it used to work in a previous version of AutoIt and the way given in examples in this forum. Same with the two SendMsg lines, one showing the way my script uses it, the other the way it's currently shown in forum examples. What I end up with is a date control showing a single number, eg: "5" for the actual time "5:24 PM", no minutes etc are shown. I've played around with the format of the $style string - pretty much everything I could think of - but I keep getting just a single digit shown instead of a properly formatted time. Now, I don't know what changed in AutoIt to break this functionality. How can I now correctly change the time format? Link to comment Share on other sites More sharing options...
Lazycat Posted November 21, 2007 Share Posted November 21, 2007 Now, I don't know what changed in AutoIt to break this functionality. How can I now correctly change the time format?As stated in this thread:http://www.autoitscript.com/forum/index.php?showtopic=45919you should use $DTM_SETFORMATW = 0x1032 instead $DTM_SETFORMAT for unicode version. For me this solution work fine. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
Zaxon Posted November 21, 2007 Author Share Posted November 21, 2007 you should use $DTM_SETFORMATW = 0x1032 instead $DTM_SETFORMAT for unicode version. For me this solution work fine.Thanks. Works like a charm. 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