Jump to content

I need to access another MS control...


Recommended Posts

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

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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

  • 2 years later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...