IE.au3 - Datum einsetzen

  • [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Date.au3>
    #include <IE.au3>

    [/autoit][autoit][/autoit][autoit]

    GUICreate("My GUI",180,250)

    [/autoit][autoit][/autoit][autoit]

    GuictrlcreateLabel("From",10,25,50,25)
    $from = GUICtrlCreateDate("",50,20,100,25)
    $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW
    $style = "yyyy/MM/dd"
    GUICtrlSendMsg($from, $DTM_SETFORMAT_, 0, $style)

    [/autoit][autoit][/autoit][autoit]

    GuictrlcreateLabel("To",10,65,50,25)
    $to = GUICtrlCreateDate("",50,60,100,25)
    $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW
    $style = "yyyy/MM/dd"
    GUICtrlSendMsg($to, $DTM_SETFORMAT_, 0, $style)

    [/autoit][autoit][/autoit][autoit]

    GuictrlcreateLabel("Select Shift",10,120,80,25)
    GUictrlcreateCombo("SE",80,115,50)
    Guictrlsetdata(-1,"SL|SN|DS")
    $start = Guictrlcreatebutton("Start",40,215,100,25)
    $weekend = GUICtrlCreateCheckbox("Weekend",10,170,100,25)
    GuictrlcreateButton("",-2,100,500,5)
    GUICtrlSetState(-1,$GUI_DISABLE)
    GuictrlcreateButton("",-2,150,500,5)
    GUICtrlSetState(-1,$GUI_DISABLE)
    GUISetState(@SW_SHOW) ; will display an empty dialog box

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    ; Run the GUI until the dialog is closed
    While 1
    $msg = GUIGetMsg()
    switch $msg
    case $start
    doit()
    dates()
    Endswitch
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()

    [/autoit][autoit][/autoit][autoit]

    Func Date()
    $datefrom= Guictrlread($from)
    $dateto = Guictrlread($to)
    $x = _DateDiff('D',$datefrom,$dateto)
    for $i = 0 to $x
    $xd = _DateAdd('D',$i,$datefrom)
    global $lol = _DateTimeFormat($xd,2)
    Next
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func doit()
    $url = "http://www.URL.de"
    Global $oIE = _IECreate($url)
    global $oform = _IEFormGetCollection($oIE, 0)
    $obutton = _IEFormElementGetObjByName($oform , "DropDownListKind")
    _IEFormElementOptionSelect($obutton,"Arbeitszeit",1, "byText")
    Endfunc

    [/autoit][autoit][/autoit][autoit]

    func dates()
    $obutton = _IEFormElementGetObjByName($oform , "TextBoxDateFrom")
    _IEFormElementSetValue($obutton,"20.02.2013") ;Eintrag wird vorgenommen, aber fliegt nach einer Sekunde wieder raus
    $obutton = _IEFormElementGetObjByName($oform , "TextBoxDateTo")
    _IEFormElementSetValue($obutton,"20.02.2013") ;Eintrag wird vorgenommen, aber fliegt nach einer Sekunde wieder raus
    ENdfunc

    [/autoit]