everseeker Posted April 22, 2008 Share Posted April 22, 2008 I thought this would work ControlSetText("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1]", "06/30/2008") I was wrong Anyone have a clean way to do this? (Actually, I have a variable in my working code... but it is a simple string of the XX\YY\XXXX flavor... tried the above, it fails the same way... So if the above is made to work, I can revise ad extend..... Looked at Date.Au3.... nothing there helpful Everseeker Link to comment Share on other sites More sharing options...
Bowmore Posted April 22, 2008 Share Posted April 22, 2008 I thought this would work ControlSetText("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1]", "06/30/2008") I was wrong Anyone have a clean way to do this? (Actually, I have a variable in my working code... but it is a simple string of the XX\YY\XXXX flavor... tried the above, it fails the same way... So if the above is made to work, I can revise ad extend..... Looked at Date.Au3.... nothing there helpfulTo set the currently selected date/time in the datepicker try this function _GUICtrlDTP_SetSystemTime() in GuiDateTimePicker.au3 "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
everseeker Posted April 22, 2008 Author Share Posted April 22, 2008 (edited) To set the currently selected date/time in the datepicker try this function _GUICtrlDTP_SetSystemTime()in GuiDateTimePicker.au3OK, I am way confused now...1. _GUICtrlDTP_SetSystemTime() appears to be a way to set the value of a control, created by autoit, to the system time.How does that relate to my need to set the value of an EXTERNAL application's Date, to an arbatrary (NOT System time) date?2. What is/Where is GuiDateTimePicker.au3 (Didn't find it in the help ref...) Found it...Looking at the help file, I think I may be getting it...Can you use this to modify a control OTHER then the one you set up yourself?If so, could someone give me a hint (better then the one in the help file....) Edited April 22, 2008 by everseeker Everseeker Link to comment Share on other sites More sharing options...
everseeker Posted April 22, 2008 Author Share Posted April 22, 2008 OK, I am way confused now... 1. _GUICtrlDTP_SetSystemTime() appears to be a way to set the value of a control, created by autoit, to the system time. How does that relate to my need to set the value of an EXTERNAL application's Date, to an arbatrary (NOT System time) date? 2. What is/Where is GuiDateTimePicker.au3 (Didn't find it in the help ref...) Found it... Looking at the help file, I think I may be getting it... Can you use this to modify a control OTHER then the one you set up yourself? If so, could someone give me a hint (better then the one in the help file....)So, If I understand correctly, $hGUI = GUICreate("(External) DateTimePick Set System Time", 400, 300) $hDTP = _GUICtrlDTP_Create($hGUI, 2, 6, 190) $imemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0) GUICtrlSetFont($imemo, 9, 400, 0, "Courier New") GUISetState()oÝ÷ Ú+,zاêZ«¨µìmz¹Ú«¨¶¢ë-~ì¢g)ඬzÚ zÖªºajwez«¨µ8^«¢+ØìMÐÍåÍÑ´Ñ¥µ)}U% ÑɱQA}MÑMåÍѵQ¥µ ÀÌØí¡Q@°ÀÌØí}Ñpushes the time, stored in an array, to that handle... If this is correct, All I need to do is figure out how to assign a "handle" to my control... ummmmm.... Everseeker Link to comment Share on other sites More sharing options...
everseeker Posted April 22, 2008 Author Share Posted April 22, 2008 (edited) So, If I understand correctly, $hGUI = GUICreate("(External) DateTimePick Set System Time", 400, 300) $hDTP = _GUICtrlDTP_Create($hGUI, 2, 6, 190) $imemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0) GUICtrlSetFont($imemo, 9, 400, 0, "Courier New") GUISetState()oÝ÷ Ú+,zاêZ«¨µìmz¹Ú«¨¶ ¢ë-~ì¢g­)ඬzÚ zÖªºajwez«¨µ8^«­¢+ØìMÐÍåÍÑ´Ñ¥µ")}U% ÑɱQA}MÑMåÍѵQ¥µ" ÀÌØí¡Q@°ÀÌØí}Ñ"oÝ÷ Ú¬ë-ëbë-¢·v§jºÚÊÚ-«ajwexí+"±Ê+­ç-YHç¶hÇâêÞ¢ëa£ hjË"vªºajwez«¨¶Ú&ÉÊ'¶º%ºi¦oêº^jëh×6#include <GuiConstantsEx.au3> #include <GuiDateTimePicker.au3> ;... ;calling setup Global $a_Date[7] = [False, @YEAR, 8, 10, 21, 57, 34] DateTimeControlSetup("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1], $a_Date) ;... ;Called function Func DateTimeControlSetup($winTitle, $winText, $control, $TimArray) Local $hWnd = ControlGetHandle($winTitle, $winText, $control) _GUICtrlDTP_SetSystemTime($hWnd, $TimArray) EndFunc ;==>DateTimeControlSetup ;... Is not working... am I missing something? -------------------------------------------- Um.... Let me be the first to say D'oh Return True would be a big help here, huh NOW it works Edited April 22, 2008 by everseeker Everseeker Link to comment Share on other sites More sharing options...
evilertoaster Posted April 22, 2008 Share Posted April 22, 2008 Don't know if it's the actual issue, but you have a syntax error there- DateTimeControlSetup("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1]", $a_Date) instead of DateTimeControlSetup("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1], $a_Date) Link to comment Share on other sites More sharing options...
everseeker Posted April 22, 2008 Author Share Posted April 22, 2008 Don't know if it's the actual issue, but you have a syntax error there- DateTimeControlSetup("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1]", $a_Date) instead of DateTimeControlSetup("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1], $a_Date) that too Everseeker Link to comment Share on other sites More sharing options...
everseeker Posted April 22, 2008 Author Share Posted April 22, 2008 (edited) So, If I understand correctly, expandcollapse popup$hGUI = GUICreate("(External) DateTimePick Set System Time", 400, 300) $hDTP = _GUICtrlDTP_Create($hGUI, 2, 6, 190) $imemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0) GUICtrlSetFont($imemo, 9, 400, 0, "Courier New") GUISetState()oÝ÷ Ú+,zاêZ«¨µìmz¹Ú«¨¶ ¢ë-~ì¢g­)ඬzÚ zÖªºajwez«¨µ8^«­¢+ØìMÐÍåÍÑ´Ñ¥µ")}U% ÑɱQA}MÑMåÍѵQ¥µ" ÀÌØí¡Q@°ÀÌØí}Ñ"oÝ÷ Ú¬ë-ëbë-¢·v§jºÚÊÚ-«ajwexí+"±Ê+­ç-YHç¶hÇâêÞ¢ëa£ hjË"vªºajwez«¨¶Ú&ÉÊ'¶º%ºi¦oêº^jëh×6#include <GuiConstantsEx.au3> #include <GuiDateTimePicker.au3> ;... ;calling setup Global $a_Date[7] = [False, @YEAR, 8, 10, 21, 57, 34] DateTimeControlSetup("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1], $a_Date) ;... ;Called function Func DateTimeControlSetup($winTitle, $winText, $control, $TimArray) Local $hWnd = ControlGetHandle($winTitle, $winText, $control) _GUICtrlDTP_SetSystemTime($hWnd, $TimArray) EndFunc ;==>DateTimeControlSetup ;...oÝ÷ Ø'¢Ü(®H§©+,x,¢g)àþ«¨µæÖ9oÛ"ØbD.Ézr«¨» xßr'q«j|¨éÞyÛ-çîËb¢v¥Ü«pjÈî²Ü(®G¢ëZnÞêÞج~º&+®*mjëh×6#include <GuiConstantsEx.au3> #include <GuiDateTimePicker.au3> ;... ;calling setup Global $a_Date[7] = [False, @YEAR, 8, 10, 21, 57, 34] $a_Date[1] = StringMid($EffDateToUse, 1, 4) $a_Date[2] = StringMid($EffDateToUse, 5, 2) $a_Date[3] = StringMid($EffDateToUse, 7, 2) DateTimeControlSetup("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1]", $a_Date) ;... ;Called function Func DateTimeControlSetup($winTitle, $winText, $control, $TimArray) Local $hWnd = ControlGetHandle($winTitle, $winText, $control) _GUICtrlDTP_SetSystemTime($hWnd, $TimArray) Return True EndFunc ;==>DateTimeControlSetup ;... And yes, it works perfectly now! Thanks to all If this helps anyone else, enjoy Edited April 22, 2008 by everseeker Everseeker Link to comment Share on other sites More sharing options...
ResNullius Posted April 22, 2008 Share Posted April 22, 2008 Along the lines of your first post, I've always had success with ControlFocus(("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1]") ControlSend("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1]", "06/30/2008") I've always had to focus the control before the send though. Link to comment Share on other sites More sharing options...
everseeker Posted April 22, 2008 Author Share Posted April 22, 2008 Along the lines of your first post, I've always had success with ControlFocus(("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1]") ControlSend("Rate Calculator", "", "[CLASSNN:WindowsForms10.SysDateTimePick32.app.0.378734a1]", "06/30/2008") I've always had to focus the control before the send though. But...But...But.... The new way is so much more pretty ... and complicatimatifirized even... Everseeker Link to comment Share on other sites More sharing options...
ph0tix Posted January 25, 2011 Share Posted January 25, 2011 (edited) The above code snippets from everseeker seem to contain a lot of garbage text to me.. is this a local issue or a known issue on the forum? Thanks all Edited January 25, 2011 by ph0tix 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