Jump to content

Recommended Posts

Posted

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

Posted

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

To 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

Posted (edited)

To set the currently selected date/time in the datepicker try this function

_GUICtrlDTP_SetSystemTime()

in GuiDateTimePicker.au3

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....)

Edited by everseeker

Everseeker

Posted

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

Posted (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í+"±Ê+&shy;ç-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 :D

NOW it works

Edited by everseeker

Everseeker

Posted

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)

Posted

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 :D

Everseeker

Posted (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&shy;)ඬzÚ zÖªºajwez«¨µ8^«&shy;¢+ØìMÐÍåÍÑ´Ñ¥µ")}U%
ÑɱQA}MÑMåÍѵQ¥µ" ÀÌØí¡Q@°ÀÌØí}Ñ"oÝ÷ Ú¬ë-ëbë-¢·v§jºÚÊÚ-«ajwexí+"±Ê+&shy;ç-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 :D

Edited by everseeker

Everseeker

Posted

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.

Posted

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

  • 2 years later...
Posted (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 by ph0tix

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...