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

Beiträge von K4z

  • Öffnen eines Programms mit Run / ShellExecute sowie über CMD schlägt fehl

    • K4z
    • 21. Januar 2012 um 22:45

    Sicher, dass du Adminrechte hast? kannst ja ma so versuchen:

    [autoit]

    #RequireAdmin
    ShellExecute(@SystemDir & "\Soundrecorder.exe")

    [/autoit]
  • Öffnen eines Programms mit Run / ShellExecute sowie über CMD schlägt fehl

    • K4z
    • 21. Januar 2012 um 22:37

    Ja kannst du ihn normal öffnen? sehr werkwürdig, wenn du ihn nicht mal über die cmd starten kannst....

  • Öffnen eines Programms mit Run / ShellExecute sowie über CMD schlägt fehl

    • K4z
    • 21. Januar 2012 um 22:31

    ShellExecute("Soundrecorder.exe") ?!
    klappt bei mir perfekt

  • SQLite Abfrage klappt mit Variable nicht

    • K4z
    • 20. Januar 2012 um 19:24

    du kannst es ja mal mit StringFormat probieren:

    [autoit]

    _SQLite_Query(-1, StringFormat("SELECT DateiName, DateiGroesse FROM DateiDaten Where DiskNummer = '' AND Dateigroesse = (SELECT MAX(Dateigroesse) FROM DateiDaten WHERE Dateigroesse < %i)", $DiskFrei), $hQuery)

    [/autoit]
  • MsgBox Generator - Die 128ste

    • K4z
    • 20. Januar 2012 um 14:33

    Vielleicht noch eine kleine Anregung, wie man das mit ner Whileschleife abfragen könnte, man muss allerdings dann seine Variablen geschickt benennen...
    Ach und ich würd aus den RadioButtons bei Sonsitges Checkboxen machen, da beides gleichzeitig zutreffen kann.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #region GUI
    $hGui = GUICreate("MsgBox-Generator", 366, 507, 373, 20)
    GUICtrlCreateLabel("Icon:", 16, 152, 28, 17)
    GUICtrlCreateLabel("Standard Button:", 224, 16, 84, 17)
    GUICtrlCreateLabel("Sonstiges:", 224, 88, 53, 17)
    GUICtrlCreateLabel("Modalität:", 224, 184, 50, 17)
    GUICtrlCreateLabel("Ausgabe:", 16, 448, 49, 17)
    GUICtrlCreateLabel("_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _", 16, 352, 340, 17)
    GUICtrlCreateLabel("Titel:", 16, 256, 27, 17)
    GUICtrlCreateLabel("Text:", 16, 304, 28, 17)

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

    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $hRadio0= GUICtrlCreateRadio("OK", 16, 32, 33, 17)
    $hRadio1 = GUICtrlCreateRadio("OK und Abbrechen", 16, 48, 113, 17)
    $hRadio2 = GUICtrlCreateRadio("Abbrechen, Wiederholen, Ignorieren", 16, 64, 193, 17)
    $hRadio3 = GUICtrlCreateRadio("Ja, Nein, Abbrechen", 16, 80, 121, 17)
    $hRadio4 = GUICtrlCreateRadio("Ja und Nein", 16, 96, 81, 17)
    $hRadio5 = GUICtrlCreateRadio("Wiederholen und Abbrechen", 16, 112, 161, 17)
    $hRadio6 = GUICtrlCreateRadio("Abbrechen, Wiederholen, Weiter", 16, 128, 177, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $hRadio7 = GUICtrlCreateRadio("Erster Button", 224, 32, 81, 17)
    $hRadio8 = GUICtrlCreateRadio("Zweiter Button", 224, 48, 89, 17)
    $hRadio9 = GUICtrlCreateRadio("Dritter Button", 224, 64, 81, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $hRadio10 = GUICtrlCreateRadio("Kein Icon", 16, 168, 65, 17)
    $hRadio11 = GUICtrlCreateRadio("Stopp-Zeichen", 16, 184, 89, 17)
    $hRadio12 = GUICtrlCreateRadio("Fragezeichen", 16, 200, 89, 17)
    $hRadio13 = GUICtrlCreateRadio("Ausrufezeichen", 16, 216, 97, 17)
    $hRadio14 = GUICtrlCreateRadio("Information", 16, 232, 73, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $hRadio15 = GUICtrlCreateRadio("Anwendung", 224, 200, 81, 17)
    $hRadio16 = GUICtrlCreateRadio("System-modal", 224, 216, 89, 17)
    $hRadio17 = GUICtrlCreateRadio("Task-modal", 224, 232, 81, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $hRadio18 = GUICtrlCreateCheckbox("immer im Vordergrund", 224, 104, 121, 17)
    $hRadio19 = GUICtrlCreateCheckbox("Text rechtsbündig", 224, 120, 105, 17)
    $hRadio20 = GUICtrlCreateLabel("Buttons:", 16, 16, 43, 17)

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

    $hInptOut = GUICtrlCreateInput("", 16, 472, 329, 21)
    $hInptTitle = GUICtrlCreateInput("Überschrift", 16, 280, 329, 21)
    $hInptText = GUICtrlCreateInput("Ich bin eine Msgbox!", 16, 328, 329, 21)
    $hCheckTest = GUICtrlCreateCheckbox("Testen?", 280, 440, 65, 17)
    $hBtnGo = GUICtrlCreateButton("MsgBox Generieren", 16, 384, 331, 41, $WS_GROUP)
    GUICtrlSetState($hRadio0,$GUI_CHECKED)
    GUICtrlSetState($hRadio7,$GUI_CHECKED)
    GUICtrlSetState($hRadio10,$GUI_CHECKED)
    GUICtrlSetState($hRadio15,$GUI_CHECKED)
    GUICtrlSetState($hCheckTest,$GUI_CHECKED)
    GUISetState(@SW_SHOW)
    #endregion GUI

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $hBtnGo
    generate()
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

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

    func generate()
    Local $sResult, $flag = 0, $titel = GUICtrlRead($hInptTitle), $text = GUICtrlRead($hInptText)
    Dim $aFlags[20]=[0,1,2,3,4,5,6,0,256,512,0,16,32,48,64,0,4096,8192,262144,524288]

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

    For $iI=0 To 19 Step 1
    If GUICtrlRead(Eval("hRadio" & $iI)) = 1 Then
    $flag += $aFlags[$iI]
    EndIf
    Next

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

    $sResult = StringFormat('MsgBox(%i, "%s", "%s")', $flag, $titel, $text)
    GUICtrlSetData($hInptOut,$sResult)
    If GUICtrlRead($hCheckTest) = 1 Then Execute($sResult)
    EndFunc

    [/autoit]
  • MsgBox Generator - Die 128ste

    • K4z
    • 20. Januar 2012 um 13:47

    Nein kann man nich:D Wenn ein case zutrifft, dann ist das eine Abbruchbedingung für die Selectschleife, dadurch würde dann zum Beispiel das selectieren von nem Icon vom Script gar nicht realisiert werden...

  • MsgBox Generator - Die 128ste

    • K4z
    • 19. Januar 2012 um 15:13

    mit select():

    [autoit]

    Select
    Case GUICtrlRead($btn1) = 1
    $flag += 1
    Case GUICtrlRead($btn2) = 1
    $flag += 2
    Case GUICtrlRead($btn3) = 1
    $flag += 3
    Case GUICtrlRead($btn4) = 1
    $flag += 4
    Case GUICtrlRead($btn5) = 1
    $flag += 5
    Case GUICtrlRead($btn6) = 1
    $flag += 6
    EndSelect
    Select
    Case GUICtrlRead($ic1) = 1
    $flag += 16
    Case GUICtrlRead($ic2) = 1
    $flag += 32
    Case GUICtrlRead($ic3) = 1
    $flag += 48
    Case GUICtrlRead($ic4) = 1
    $flag += 64
    EndSelect
    Select
    Case GUICtrlRead($mod1) = 1
    $flag += 4096
    Case GUICtrlRead($mod2) = 1
    $flag += 8192
    EndSelect
    Select
    Case GUICtrlRead($std1) = 1
    $flag += 256
    Case GUICtrlRead($std2) = 1
    $flag += 512
    EndSelect
    Select
    Case GUICtrlRead($son1) = 1
    $flag += 262144
    Case GUICtrlRead($son2) = 1
    $flag += 524288
    EndSelect

    [/autoit]

    aber obs so wirklich übersichtlicher wird ist fraglich.... ich hätts jetzt sowieso lieber mit comboboxen gemacht...

  • Sound

    • K4z
    • 17. Januar 2012 um 21:27

    Da war doch tatsächlich jemand so sozial en plugin zu schreiben, das mit der EndpointVolume API kommuniziert:D
    http://www.autoitscript.com/forum/topic/84…-master-volume/

    _SetMasterVolumeScalar_Vista() klappt bei mir perfekt, ich glaubs nich :thumbup:
    Es würd dann z.B so aussehn(vista_vol.dll im selben Ordner):

    [autoit]

    #AutoIt3Wrapper_Plugin_Funcs=_SetMasterVolumeScalar_Vista

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

    $hDLL = PluginOpen("vista_vol.dll")

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

    ; ## Set new volume levels
    _SetMasterVolumeScalar_Vista(32)

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

    PluginClose($hDLL)

    [/autoit]
  • Sound

    • K4z
    • 17. Januar 2012 um 19:47

    Also zum Problem mit der Systemlautstärke:
    Ich hatte vor einiger Zeit auch mal vor die Gesamtlautstärke einzustellen. Leider gehen die ganzen UDFs die ich dazu gefunden hab nicht bei win7 und ich hatte auch keine Lust jetzt nen aufwendigen dllcall oder Objects zu machen. Ich habs dann letztendlich einfach mit Send-Befehlen gelöst, da ich es jetzt auch nicht 100% genau einstellen wollte:

    [autoit]

    Opt("SendKeyDelay", 0)
    Opt("SendKeyDownDelay", 0)

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

    _SetMainVol(32)

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

    Func _SetMainVol($iVol)
    Send("{VOLUME_up 50}")

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

    If $iVol = 100 Then
    Return
    ElseIf $iVol<45 Then
    $iPike = 50
    Else
    $iPike = 49
    EndIf

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

    Send("{VOLUME_DOWN "& Int($iPike-(($iVol/100)*48)) & "}")
    EndFunc

    [/autoit]


    Das ist zwar ziemlich "hässlich", aber ich kann meine Lautstärke so immerhin mit ner Ungenauigkeit von 1% einstellen...
    Ein weiterer nachteil ist, dass die Funktion knapp 1 Sekunde benötigt...

    Ich hoff jemand hat eine bessere Lösung, denn daran wär ich auch schwerstens interressiert:D:D

  • Problem mit Umlauten beim Versenden von E-Mail?

    • K4z
    • 17. Januar 2012 um 16:32

    Vielleicht liegts ja am Charset... Aber da _InetMail() das Standard-EmailProgramm benützt um Emails zu versenden, hab ich mal das Script so umgeändert, dass es ohne Email-Programm Emails verschickt und zusätzlich das Charset ISO 8859-1 benützt....
    Musst halt die Daten von deinem Email Acc eintragen.
    Du kannst es ja einfach mal probieren, ob sich was tut:D

    [autoit]

    #include <INet.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>

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

    $s_SmtpServer = "" ;http://www.hoffmann-software.de/FrEewARE/Liste…SMTP-Server.htm
    $s_FromName = ""
    $s_FromAddress = ""
    $s_UName = ""
    $s_PWD = ""

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

    Global $section, $combodata
    $section = IniReadSection("Email.ini", "Emails")
    Dim $Checkbox[$section[0][0] + 1]
    _ArraySort($section, 0, 0, 0, 0)

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

    $Form1 = GUICreate("e-mail Programm", 400, Round($section[0][0] / 2) * 20 + 290)
    For $i = 1 To $section[0][0]
    $Checkbox[$i] = GUICtrlCreateCheckbox($section[$i][0], 205 - Mod($i, 2) * 200, 5 + (Round($i / 2) - 1) * 20, 190, 25)
    Next
    $label1 = GUICtrlCreateLabel("_________________________________________________________________", 5, (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20 + 4, 390, 25)
    $label2 = GUICtrlCreateLabel("Betreff:", 5, 18 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Input1 = GUICtrlCreateInput(IniRead("Email.ini", "Standards", "Betreff", ""), 5, 35 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
    GUICtrlSetBkColor(-1, 0xFFFFE1)
    $label2 = GUICtrlCreateLabel("Nachrichttext:", 5, 78 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Edit1 = GUICtrlCreateEdit(StringReplace(IniRead("Email.ini", "Standards", "Nachricht", ""), " |@CRLF| ", @CRLF), 5, 95 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 100)
    GUICtrlSetBkColor(-1, 0xFFFFE1)
    $label3 = GUICtrlCreateLabel("Empfänger:", 5, 213 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
    GUICtrlSetColor(-1, 0x1B79D9)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $Input2 = GUICtrlCreateInput("", 5, 230 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $Button1 = GUICtrlCreateButton("Standards speichern", 5, 260 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 150, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button3 = GUICtrlCreateButton("ini öffnen", 170, 260 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 90, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button2 = GUICtrlCreateButton("Email senden", 275, 260 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 120, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetBkColor(-1, 0xC0DCC0)
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Checkbox[1] To $Checkbox[$section[0][0]]
    $emails = ""
    For $i = 1 To $section[0][0]
    If BitAND(GUICtrlRead($Checkbox[$i]), $GUI_CHECKED) Then
    $emails &= $section[$i][1] & "; "
    EndIf
    Next
    GUICtrlSetData($Input2, $emails)
    Case $Button1
    IniWrite("Email.ini", "Standards", "Betreff", GUICtrlRead($Input1))
    IniWrite("Email.ini", "Standards", "Nachricht", StringReplace(GUICtrlRead($Edit1), @CRLF, " |@CRLF| "))
    Case $Button2
    Dim $as_Body[1]
    $as_Body[0] = GUICtrlRead($Edit1) & @CRLF

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

    $as_ToAddress = StringSplit(GUICtrlRead($Input2), ";")
    If StringStripWS($as_ToAddress[$as_ToAddress[0]], 8) = "" Then
    _ArrayPop($as_ToAddress)
    $as_ToAddress[0] -= 1
    EndIf

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

    For $i_i = 1 To $as_ToAddress[0]
    _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $as_ToAddress[$i_i], $s_UName, $s_PWD, GUICtrlRead($Input1), $as_Body)
    If @error Then
    MsgBox(0, "Error!", "Mail failed with error code " & @error)
    ExitLoop
    Else
    MsgBox(0, "Success!", "Mail sent")
    EndIf
    Next
    ;_INetMail(GUICtrlRead($Input2), GUICtrlRead($Input1), GUICtrlRead($Edit1) & @CRLF)

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

    Case $Button3
    ShellExecute(@ScriptDir & "\Email.ini")
    EndSwitch
    WEnd

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

    ;===============================================================================
    ;
    ; Function Name: _INetSmtpMailAuth()
    ; Description: Sends an email using SMTP over TCP IP.
    ; Parameter(s): $s_SmtpServer - SMTP server to be used for sending email
    ; $s_FromName - Name of sender
    ; $s_FromAddress - eMail address of sender
    ; $s_ToAddress - Address that email is to be sent to
    ; $s_Username - Username for Authentication (bernd670)
    ; $s_Passwd - Password for Authentication (bernd670)
    ; $s_Subject - Subject of eMail
    ; $as_Body - Single dimension array containing the body of eMail as strings
    ; $s_helo - Helo identifier (default @COMPUTERNAME) sometime needed by smtp server
    ; $s_first - send before Helo identifier (default @CRLF) sometime needed by smtp server
    ; $b_trace - trace on a splash window (default 0 = no trace)
    ; Requirement(s): None
    ; Return Value(s): On Success - Returns 1
    ; On Failure - 0 and sets
    ; @ERROR = 1 - Invalid Parameters
    ; @ERROR = 2 - Unable to start TCP
    ; @ERROR = 3 - Unable to resolve IP
    ; @ERROR = 4 - Unable to create socket
    ; @ERROR = 5x - Cannot open SMTP session
    ; @ERROR = 50x - Cannot send body
    ; @ERROR = 5000 - Cannot close SMTP session
    ; Authors: Original function to send email via TCP - Asimzameer
    ; Conversion to UDF - Walkabout
    ; Correction Helo, timeout, trace - Jpm
    ; Correction send before Helo - Jpm
    ; Include Authentication - bernd670
    ;
    ;===============================================================================
    Func _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Username, $s_Passwd, $s_Subject = "", $as_Body = "", $s_helo = "", $s_first = "-1", $b_trace = 0)

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

    Local $v_Socket
    Local $s_IPAddress
    Local $i_Count
    Local $s_Send[9]
    Local $s_ReplyCode[9];Return code from SMTP server indicating success

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

    If $s_SmtpServer = "" Or $s_FromAddress = "" Or $s_ToAddress = "" Or $s_Username = "" Or $s_Passwd = "" Or $s_FromName = "" Or StringLen($s_FromName) > 256 Then
    SetError(1)
    Return 0
    EndIf
    If $s_helo = "" Then $s_helo = @ComputerName
    If TCPStartup() = 0 Then
    SetError(2)
    Return 0
    EndIf
    StringRegExp($s_SmtpServer, "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
    If @extended Then
    $s_IPAddress = $s_SmtpServer
    Else
    $s_IPAddress = TCPNameToIP($s_SmtpServer)
    EndIf
    If $s_IPAddress = "" Then
    TCPShutdown()
    SetError(3)
    Return 0
    EndIf
    $v_Socket = TCPConnect($s_IPAddress, 25)
    If $v_Socket = -1 Then
    TCPShutdown()
    SetError(4)
    Return (0)
    EndIf

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

    $s_Send[0] = "EHLO " & $s_helo & @CRLF
    $s_ReplyCode[0] = "250"

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

    $s_Send[1] = "AUTH LOGIN" & @CRLF
    $s_ReplyCode[1] = "334"
    $s_Send[2] = _Base64Encoding($s_Username) & @CRLF
    $s_ReplyCode[2] = "334"
    $s_Send[3] = _Base64Encoding($s_Passwd) & @CRLF
    $s_ReplyCode[3] = "235"
    $s_Send[4] = "MAIL FROM: <" & $s_FromAddress & ">" & @CRLF
    $s_ReplyCode[4] = "250"
    $s_Send[5] = "RCPT TO: <" & $s_ToAddress & ">" & @CRLF
    $s_ReplyCode[5] = "250"
    $s_Send[6] = "DATA" & @CRLF
    $s_ReplyCode[6] = "354"

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

    $s_Send[7] = "From: " & $s_FromName & " <" & $s_FromAddress & ">" & @CRLF & _
    "To: " & "<" & $s_ToAddress & ">" & @CRLF & _
    "Subject: " & $s_Subject & @CRLF & _
    "Mime-Version: 1.0" & @CRLF & _
    "Content-Type: text/plain; charset=ISO 8859-1" & @CRLF & _ ;<---------------------CHARSET-------------------
    @CRLF
    $s_ReplyCode[7] = ""

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

    $s_Send[8] = @CRLF & "." & @CRLF
    $s_ReplyCode[8] = "250"

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

    ; open stmp session
    If __SmtpSend($v_Socket, $s_Send[0], $s_ReplyCode[0], $b_trace, "220", $s_first) Then
    SetError(50)
    Return 0
    EndIf

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

    ; send header
    For $i_Count = 0 To UBound($s_Send) - 2
    If __SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
    SetError(50 + $i_Count)
    Return 0
    EndIf
    Next

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

    ; send body records (a record can be multiline : take care of a subline beginning with a dot should be ..)
    For $i_Count = 0 To UBound($as_Body) - 1
    ; correct line beginning with a dot
    If StringLeft($as_Body[$i_Count], 1) = "." Then $as_Body[$i_Count] = "." & $as_Body[$i_Count]

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

    If __SmtpSend($v_Socket, $as_Body[$i_Count] & @CRLF, "", $b_trace) Then
    SetError(500 + $i_Count)
    Return 0
    EndIf
    Next

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

    ; close the smtp session
    $i_Count = UBound($s_Send) - 1
    If __SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
    SetError(5000)
    Return 0
    EndIf

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

    TCPCloseSocket($v_Socket)
    TCPShutdown()
    Return 1
    EndFunc ;==>_INetSmtpMailAuth

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

    ;===============================================================================
    ;
    ; Function Name: _Base64Encoding()
    ; Description: Kodiert eine Zeichenfolge mit dem Base64-Verfahren
    ; (http://de.wikipedia.org/wiki/Base64)
    ; Parameter(s): $String - Zeichenfolge die kodiert werden soll
    ; Requirement(s): None
    ; Return Value(s): Kodierte Zeichenfolge
    ; Authors: bernd670
    ;
    ;===============================================================================
    Func _Base64Encoding($String)

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

    $strUmsetzung = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
    $strRetValue = ""

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

    For $i = 1 To StringLen($String) Step 3
    $strTok = StringMid($String, $i, 3)
    Switch StringLen($strTok)
    Case 3
    $iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
    Asc(StringMid($strTok, 2, 1))) * 256 + _
    Asc(StringMid($strTok, 3, 1))
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt

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

    Case 2
    $iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
    Asc(StringMid($strTok, 2, 1))) * 256
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt & "="

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

    Case 1
    $iTokVal = Asc(StringMid($strTok, 1, 1)) * 65536
    $iTokVal = BitShift($iTokVal, 12)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt & "=="

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

    EndSwitch
    Next

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

    Return $strRetValue
    EndFunc ;==>_Base64Encoding

    [/autoit]
  • Drag & Drop mit Listviews

    • K4z
    • 13. Januar 2012 um 23:51

    oh habs falsch gelesen.. aber hat sich ja geklärt

  • Drag & Drop mit Listviews

    • K4z
    • 13. Januar 2012 um 21:41

    Sodele hab da mal was ausgegraben, dass ich vor langer Zeit mal gemacht hab und bissle verändert.
    Du kannst dabei sogar mehrere Einträge aufeinmal verschieben:

    [autoit]

    #Include <GuiListBox.au3>

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

    GUICreate("", 576, 438, 409, 292)
    $hListLeft = GUICtrlCreateList("", 16, 8, 217, 409, $LBS_EXTENDEDSEL)
    $hListRight = GUICtrlCreateList("", 337, 10, 217, 409, $LBS_EXTENDEDSEL)
    $hBtnToRight = GUICtrlCreateButton("-->", 248, 168, 75, 25)
    $hBtnToLeft = GUICtrlCreateButton("<--", 248, 200, 75, 25)
    GUISetState(@SW_SHOW)

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

    ; // ListItems generieren
    _GUICtrlListBox_BeginUpdate($hListLeft)
    For $iI = 1 To 9
    _GUICtrlListBox_AddString($hListLeft, StringFormat("hListLeft item: %i", $iI))
    Next
    _GUICtrlListBox_EndUpdate($hListLeft)
    _GUICtrlListBox_BeginUpdate($hListRight)
    For $iI = 1 To 9
    _GUICtrlListBox_AddString($hListRight, StringFormat("hListLeft item: %i", $iI))
    Next
    _GUICtrlListBox_EndUpdate($hListRight)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $hBtnToRight
    _TransferItems($hListLeft, $hListRight)
    Case $hBtnToLeft
    _TransferItems($hListRight, $hListLeft)
    EndSwitch
    WEnd

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

    Func _TransferItems($hList1, $hList2)
    $aSelectedItems = _GUICtrlListBox_GetSelItems($hList1)

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

    For $iI = $aSelectedItems[0] To 1 Step -1
    _GUICtrlListBox_AddString($hList2, _GUICtrlListBox_GetText($hList1, $aSelectedItems[$iI]))
    _GUICtrlListBox_DeleteString($hList1, $aSelectedItems[$iI])
    Next
    EndFunc

    [/autoit]
  • "Filemove" nur mit bestimmten Datein möglich?

    • K4z
    • 11. Januar 2012 um 20:04

    _FileReadToArray() prüft schon selber ob die Datei überhaupt existiert, wenn sie nich existiert, dann setzt es @Error auf 1...

    [autoit]

    _FileReadToArray(@ScriptDir & "\Titel der Folgen.txt", $namen)
    If @error = 1 Then
    MsgBox(0, "Error", "Datei existiert nicht.")
    ElseIf @error = 2 Then
    MsgBox(0, "Error", "Fehler beim Einlesen der Datei")
    EndIf

    [/autoit]


    Also zumindest ich empfinde das als bessere Lösung...
    Aber jeder hat seinen eigenen Stil

    Also ich denke Error handling ist wirklich ein wichtiges Thema, schau dir mal den Thread von Andy an.
    Du erleichterst dir das Programmieren einfach ungemein.
    Sei nicht böse, ich will dir nur helfen :thumbup:

  • "Filemove" nur mit bestimmten Datein möglich?

    • K4z
    • 11. Januar 2012 um 19:30

    @sillyboy vlt en paar tipps:
    - Autoit-Quellcode tag benützen
    - FileOpen() ist in dem Fall unnötig... Wenn dann würd ich halt wenigstens dann das handle in _FileReadToArray() weiterverwenden:D
    - wenn man fileopen benützt, sollte man die Datei mit FileClose() wieder schließen

  • "Filemove" nur mit bestimmten Datein möglich?

    • K4z
    • 11. Januar 2012 um 19:21

    also ich könnt mir denken, dass _FileReadToArray en Error zurück gibt:

    [autoit]

    _FileReadToArray("Titel der Folgen.txt.", $namen)

    [/autoit]


    Versuchs mal ohne den Punkt hinter txt:D

  • ICQ Statusmeldung senden

    • K4z
    • 10. Dezember 2011 um 19:44

    Schau dir mal W P E pro an

  • sind sockets doch nicht bidrektional?

    • K4z
    • 29. November 2011 um 15:03

    Edit: bisschen verkürzt...

    [autoit]


    ;;;;;;;;;;;;
    ;; Server ;;
    ;;;;;;;;;;;;
    OnAutoItExitRegister("_exit")
    UDPStartup()

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

    Global Const $g_IP = @IPAddress1

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

    $aServerSocket = UDPBind($g_IP, 65432) ;gibt ein Array zurück: [1] real socket, [2] local IP, [3] Port
    If @error <> 0 Then Exit
    While 1
    $aData = UDPRecv($aServerSocket, 50, 2) ;gibt ein Array zurück: [0] data, [1] from IP, [2] from Port
    If $aData <> "" Then
    Local $aClientArray[4] = [$aServerSocket[0], $aServerSocket[1], $aData[1], $aData[2]]

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

    MsgBox(0, "UDP DATA Server", $aData[0])

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

    UDPSend($aClientArray, 'Server->Client')

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

    EndIf
    Sleep(100)
    WEnd

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

    Func _exit()
    UDPShutdown()
    EndFunc

    [/autoit]
  • sind sockets doch nicht bidrektional?

    • K4z
    • 28. November 2011 um 13:27

    wenn du nicht gerade tonnen an daten verschicken möchtest, würd ich sowieso empfehlen lieber tcp zu nehmen.
    nur meine meinung...

    EDIT: http://www.noshacks.de/anleitungen-tu…s-t1115/p1.html
    könnte ganz interessant sein

    EDIT2: Hast du sicher die UDP library gestartet?

  • Hintergrundfarbe von GroupBox ändern

    • K4z
    • 25. November 2011 um 14:59

    So einfach geht das glaube ich nicht, aber hier sind ein paar Workarounds:
    http://www.autoitscript.com/forum/topic/63…lor-of-a-group/

    mfg K4z

  • _ScreenCapture_Capture Handle

    • K4z
    • 21. November 2011 um 14:35

    Heyho,
    schau mal in der Hilfe unter _GDIPlus_BitmapCreateFromHBITMAP nach.
    Das Beispiel macht exakt das, was du willst:D

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™