-1

I am trying to set the date in a date picker field in a Windows environment (shown in attached images). It's not an AutoIt date control (I did not create this field). I used the following code:

; enter from date

$sFromDate  = "09/01/2017"
ControlFocus($hWnd, "", "WindowsForms10.SysDateTimePick32.app.01")
ControlSetText($hWnd, "", "WindowsForms10.SysDateTimePick32.app.01", $sFromDate )

The AutoIt Window Information Tool shows info about the control but not the items (month/day/year) inside it. I am looking for any tool to set the date, not necessarily AutoIt.

enter image description here

user4157124
  • 2,809
  • 13
  • 27
  • 42
Yaso
  • 99
  • 1
  • 5

1 Answers1

0

See description and example of _GUICtrlDTP_SetSystemTime https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlDTP_SetSystemTime.htm

Try to use this example:

#include <GuiDateTimePicker.au3>

Local $a_Date[7] = [False, @YEAR, 8, 19, 21, 57, 34]

$hDTP = ControlGetHandle("Set_Window_Title_Here", "", "WindowsForms10.SysDateTimePick32.app.01")
_GUICtrlDTP_SetSystemTime($hDTP, $a_Date)
matrix
  • 513
  • 3
  • 8