1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Markus123

Beiträge von Markus123

  • Inhalt der Zwischeablage auf die bestimmte E-Mail Adresse senden

    • Markus123
    • 26. September 2014 um 11:21

    Du kommst an den Inhalt deiner Zwischenablage mit ClipGet() und über ClipPut("") kannst du die Zwischenablage danach leeren.

    Das ganze kannst du dann z.B. über diese http://www.autoitscript.com/forum/topic/23…nd-attachments/ UDF verschicken .. ;)

    Spoiler anzeigen
    [autoit]


    ;##################################
    ; Include
    ;##################################
    #Include<file.au3>
    ;##################################
    ; Variables
    ;##################################
    $SmtpServer = "" ; address for the smtp-server to use - REQUIRED
    $FromName = "Name" ; name from who the email was sent
    $FromAddress = "" ; address from where the mail should come
    $ToAddress = "" ; destination address of the email - REQUIRED
    $Subject = "Test123" ; subject from the email - can be anything you want it to be
    $Body = ClipGet() ; the messagebody from the mail - can be left blank but then you get a blank mail
    $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed
    $CcAddress = "CCadress1@test.com" ; address for cc - leave blank if not needed
    $BccAddress = "BCCadress1@test.com" ; address for bcc - leave blank if not needed
    $Importance = "Normal" ; Send message priority: "High", "Normal", "Low"
    $Username = "" ; username for the account used from where the mail gets sent - REQUIRED
    $Password = "" ; password for the account used from where the mail gets sent - REQUIRED
    $IPPort = 25 ; port used for sending the mail
    $ssl = 1 ; enables/disables secure socket layer sending - put to 1 if using httpS
    ;~ $IPPort=465 ; GMAIL port used for sending the mail
    ;~ $ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS

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

    ;##################################
    ; Script
    ;##################################
    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
    If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
    EndIf
    CLipPut("")
    ;
    ; The UDF
    Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
    Local $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then
    $objEmail.HTMLBody = $as_Body
    Else
    $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
    Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
    For $x = 1 To $S_Files2Attach[0]
    $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x])
    ;~ ConsoleWrite('@@ Debug : $S_Files2Attach[$x] = ' & $S_Files2Attach[$x] & @LF & '>Error code: ' & @error & @LF) ;### Debug Console
    If FileExists($S_Files2Attach[$x]) Then
    ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF)
    $objEmail.AddAttachment($S_Files2Attach[$x])
    Else
    ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF)
    SetError(1)
    Return 0
    EndIf
    Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    If Number($IPPort) = 0 then $IPPort = 25
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
    ;Authenticated SMTP
    If $s_Username <> "" Then
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    If $ssl Then
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    EndIf
    ;Update settings
    $objEmail.Configuration.Fields.Update
    ; Set Email Importance
    Switch $s_Importance
    Case "High"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High"
    Case "Normal"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal"
    Case "Low"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low"
    EndSwitch
    $objEmail.Fields.Update
    ; Sent the Message
    $objEmail.Send
    If @error Then
    SetError(2)
    Return $oMyRet[1]
    EndIf
    $objEmail=""
    EndFunc ;==>_INetSmtpMailCom
    ;
    ;
    ; Com Error Handler
    Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description, 3)
    ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF)
    SetError(1); something to check for when this function returns
    Return
    EndFunc ;==>MyErrFunc

    [/autoit]

    alle nötigen Daten eingeben und dann solltes gehn :)

  • Anzeige mehrerer Instanzen (2) von _IECreateEmbedded() bzw. deren Inhalt in GUI funktioniert nicht gleichzeitig.

    • Markus123
    • 23. September 2014 um 13:16

    Also bei mir funktioniert das ganze so.. zumindest wird nicht zuerst die eine Seite "verworfen" bevor die andere geladen wird :)

    Spoiler anzeigen
    [autoit]

    ; ------------------------------------------------------------------------------
    ; _IECreateEmbedded() - Test
    ; ------------------------------------------------------------------------------
    #Region includes
    #include <GuiConstantsEx.au3>
    #include <IE.au3>
    #include <WindowsConstants.au3>
    #EndRegion

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

    #Region declaration
    Local $sHTML1 = '<ul><li>Linke Seite</li></ul>'
    Local $sHTML2 = '<ol><li>Rechte Seite</li><ol>'
    Local $oIE1 = _IECreateEmbedded()
    Local $oIE2 = _IECreateEmbedded()
    #EndRegion

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

    #Region GUI
    GUICreate( "_IECreateEmbedded() - Test", 800, 400)

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

    GUICtrlCreateObj( $oIE1, 10, 10, 390, 380 )
    GUICtrlCreateObj( $oIE2, 410, 10, 390, 380 )
    GUISetState( @SW_SHOW )
    #EndRegion

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

    #Region IE-Object-Actions

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

    _IENavigate( $oIE1, "about:blank" )
    _IEDocWriteHTML( $oIE1, $sHTML1 )

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

    _IENavigate( $oIE2, "about:blank" )
    _IEDocWriteHTML( $oIE2, $sHTML2 )

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

    _IEAction( $oIE2, "refresh" )
    sleep(1000)
    _IEAction( $oIE1, "refresh" )

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

    #EndRegion

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

    #Region while (events)
    While 1

    $eMsg = GUIGetMsg()
    Switch $eMsg
    Case $GUI_EVENT_CLOSE
    GUIDelete()
    Exit
    EndSwitch
    WEnd
    #EndRegion

    [/autoit]
  • Pixelsearch - von unten nach oben?

    • Markus123
    • 18. September 2014 um 11:36

    Du kannst die Suchrichtung ändern indem du die entsprechenden Koordinaten deines Suchrechtecks vertauschst.. in der Hilfe wird unter Bemerkungen der Zusammenhang zwischen den Größen der Koordinaten und der Suchrichtung nochmal erklärt ;)

  • Fenster schliessen

    • Markus123
    • 17. September 2014 um 08:42

    Du kannst auslesen von welchem Fenster das Ereignis gemeldet wurde über:

    [autoit]

    $nMsg=GUIGetMsg(1)

    [/autoit]


    $nMsg[1] enthält dann den Windowhandle des Fensters von welchem das Ereignis gemeldet wurde ;)

  • Word .DOCX

    • Markus123
    • 10. September 2014 um 11:15

    Hatte keine Möglichkeit das ganze zu testen, schön dass es geholfen hat ;)

  • Word .DOCX

    • Markus123
    • 10. September 2014 um 11:01

    Hast du schonmal versucht als Namen Test.docx anzugeben?

    [autoit]


    #include <Word.au3>

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

    $word = _Word_Create()
    $doc = _Word_DocAdd($word)
    _Word_DocSaveAs($doc, @DesktopDir & "\Test.docx")

    [/autoit]

    achso.. und du nutzt den Parameter für WdOpenFormat .. eventuell bringt dich das weiter: http://msdn.microsoft.com/en-us/library/…office.12).aspx

  • If Abfrage

    • Markus123
    • 8. September 2014 um 14:31
    [autoit]

    if StringLeft($string,1)<>"-" and StringRight($string,1)<>"-" then
    ;deine MsgBox
    Endif

    [/autoit]


    würde prüfen ob sowohl erstes als auch letztes Zeichen deines Strings ungleich "-" sind ;)

  • pixelsearch - Radius

    • Markus123
    • 8. September 2014 um 14:01
    [autoit]


    $mPos = MouseGetPos()
    PixelSearch ( $mPos[0]-$radius, $mPos[1]-$radius, $mPos[0]+$radius, $mPos[1]+$radius, $farbe)

    [/autoit]


    Sucht in einem Quadrat um deine Mausposition nach der Farbe.. wenn du jetzt in einem Kreis um den Mauszeiger suchen möchtest müsstest du überprüfen ob die Ergebnisse von PixelSearch im Kreis mit dem Radius $radius liegen.

  • Programm Sicherheit/ Programm schließen verhindern

    • Markus123
    • 5. September 2014 um 14:43
    Spoiler anzeigen
    [autoit]

    #cs
    Name: Lock_Windows.au3
    Creator: Prog@ndy
    Function: Locks Windows until the right password is given
    Requires: WinLockDll.dll
    Optional:
    2 Images:
    - Locked.gif, 100 x 100 pixels
    - pw.gif 200 x 100 pixels
    #ce
    #include <GuiConstants.au3>
    DllCall("winlockdll.dll","int","Desktop_Show_Hide","int",0)
    DllCall("winlockdll.dll","int","Taskbar_Show_Hide","int",0)
    DllCall("winlockdll.dll","int","TaskSwitching_Enable_Disable","int",0)
    DllCall("winlockdll.dll","int","TaskManager_Enable_Disable","int",0)
    $gui = GUICreate("",@DesktopWidth+5,@DesktopHeight+5,-5,-5,0x80000000,0x00000080);$WS_POPUP , $WS_EX_TOOLWINDOW
    GUISetBkColor(0x0)
    WinSetOnTop($gui,"",1)
    WinSetTrans($gui,"",25)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui,"",50)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui,"",75)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui,"",100)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui,"",125)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui,"",150)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui,"",180)
    GUISetState()
    Sleep(100)
    $popup = GUICreate("Computer gesperrt",300,300, -1, -1, "0x80000000", $WS_EX_TOPMOST)
    $id_progress1=GUICtrlCreateProgress(0,0,300,30,-1,-1)
    $id_progress2=GUICtrlCreateProgress(0,270,300,30,-1,-1)
    $id_pic3=GUICtrlCreatePic("Locked.gif",0,30,100,100,-1,-1)
    $id_pic4=GUICtrlCreatePic("pw.gif",100,30,200,100,-1,-1)
    $id_label5=GUICtrlCreateLabel("Passwort eingeben:",10,174,101,13,-1,-1)
    $Input_1=GUICtrlCreateInput("",120,170,170,22,-1,-1)
    $Button_2=GUICtrlCreateButton("ENTSPERREN",65,226,159,34,-1,-1)
    GUISetState(@sw_show)
    While 1
    If NotNot WinActive("Computer gesperrt") Then
    WinActivate ("Computer gesperrt")
    ;GUISetStyle(-1, $WS_EX_TOPMOST)
    ;Beep(500,100)
    WinClose ("Task-Manager")
    EndIf
    $msg2 = GUIGetMsg()
    Select
    Case $msg2 = $Button_2
    If GUICtrlRead($Input_1) = "passwort" Then
    ExitLoop
    EndIf
    Case $msg2 = $Input_1
    If GUICtrlRead($Input_1) = "passwort" Then
    ExitLoop
    EndIf
    Case Else
    ;;;
    EndSelect
    WEnd
    GUIDelete($popup)
    #cs
    $popup = GUICreate("PopUP", 191, 85, -1, -1, $WS_DLGFRAME, $WS_EX_TOPMOST)

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

    $Input_1 = GUICtrlCreateInput("Input1", 0, 0, 180, 20)
    $Button_2 = GUICtrlCreateButton("OK", 60, 40, 60, 20)

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

    GUISetState()
    While 1
    If Not WinActive("PopUP") Then
    GUISetStyle(-1, $WS_EX_TOPMOST)
    Beep(500,100)
    EndIf
    $msg2 = GUIGetMsg()
    Select
    Case $msg2 = $Button_2
    ExitLoop
    Case Else
    ;;;
    EndSelect
    WEnd
    GUIDelete($popup)
    #ce
    ;MsgBox(262144,"","So geht es zunot..ok > close");MsgBox Set OnTop (262144)
    Sleep(300)
    WinSetTrans($gui,"",125)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui,"",100)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui,"",50)
    GUISetState()
    Sleep(100)
    DllCall("winlockdll.dll","int","Desktop_Show_Hide","int",1)
    DllCall("winlockdll.dll","int","Taskbar_Show_Hide","int",1)
    DllCall("winlockdll.dll","int","TaskSwitching_Enable_Disable","int",1)
    DllCall("winlockdll.dll","int","TaskManager_Enable_Disable","int",1)

    [/autoit]


    progandy hatte da mal was geschrieben..

  • GUI Inputbox - spezielle Eingabe sperren?

    • Markus123
    • 27. August 2014 um 13:53

    Weiß jetzt nicht ob es dafür einen Style gibt, für Inputs im allgemeinen könnte man das so lösen:

    Spoiler anzeigen
    [autoit]


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

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

    GUICreate("")
    $Inp1 = GUICtrlCreateInput("",10,10)

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

    GUISetState()
    GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")

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

    while GUIGetMsg()<>$GUI_EVENT_CLOSE
    WEnd

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

    Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam)
    Local $controlID = BitAND($wParam, 0xFFFF)
    if $controlID = $Inp1 then
    Local $string1 = GUICtrlRead($controlID)
    $string=StringReplace($string1," ","")
    if $string1<> $string then ToolTip("Keine Leerzeichen erlaubt!")
    GUICtrlSetData($controlID, $string)
    EndIf
    EndFunc

    [/autoit]
  • Datei "session.txt" (in einem fest definierten Verzeichnis) überwachen und Folgeaktion auslösen

    • Markus123
    • 26. August 2014 um 12:09

    Dein Problem sollte mit diesen Befehlen zu lösen sein ;)

    [autoit]

    FileExists ( "path" )
    FileGetTime ( "filename" [, option [, format]] )

    [/autoit]
  • Checkbox soll starten

    • Markus123
    • 26. August 2014 um 10:00

    Du musst auch für Shellexecute und Consolewrite die Checkboxen über

    [autoit]

    GUICtrlRead($acCheck[$i], 1)

    [/autoit]




    auslesen, sonst bekommst du ihren Status und nicht den Text  ;)

  • If Input = active/clicked ?

    • Markus123
    • 25. August 2014 um 17:05

    Hier noch eine Variante falls es dir speziell darum geht zu überprüfen ob ein Input geklickt wurde..

    Spoiler anzeigen
    [autoit]


    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <Misc.au3>

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

    Global $inp1, $inp2, $inp3
    $AktivesInput2=""
    $form=GUICreate(" My GUI", 320, 120)
    $inp1 = GUICtrlCreateInput("", 10, 5, 300, 20)
    $inp2 = GUICtrlCreateInput("", 10, 35, 300, 20)
    $inp3 = GUICtrlCreateInput("", 10, 65, 300, 20)
    GUISetState()

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

    while GUIGetMsg()<>$GUI_EVENT_CLOSE
    local $AktivesInput=focus()
    if $AktivesInput2<>$AktivesInput and $AktivesInput<>"" Then
    $AktivesInput2=$AktivesInput
    MsgBox("","","Input" & $AktivesInput2 & " wurde angeklickt")
    EndIf
    WEnd

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


    func Focus()
    local $arr=GUIGetCursorInfo($form), $focus=""
    if $arr[2] Then
    switch $arr[4]
    Case $inp1
    $focus="1"
    Case $inp2
    $focus="2"
    Case $inp3
    $focus="3"
    EndSwitch
    endif
    return $focus
    EndFunc

    [/autoit]

    wenn es dir nur um den Fokus geht ist die Variante von BugFix natürlich sauberer  :)

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™