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

Beiträge von nuts

  • Abfangen der Enter-Taste beim Input-Control

    • nuts
    • 2. September 2009 um 12:10

    Danke für die Beteiligung, Lösung 1 & 2 entsprechen auch meiner. Lösung 3 ist etwas seltsam funktioniert aber :thumbup:

    Der "Struktur-Teil" würde nur mit einem Edit funktionieren, ist extrem langsam (kann das sein?) und die Konstante $CBENF_RETURN ist unauffindbar.

  • "non-Array variable" und trotzdem ein Array?

    • nuts
    • 2. September 2009 um 10:58

    Also alle in Zeile 5 gefundenen Ordner haben Unterordner?

    Mach doch einfach mal eine @error Abfrage rein. Was wird angezeigt?

  • "non-Array variable" und trotzdem ein Array?

    • nuts
    • 2. September 2009 um 10:50

    Also bei max. einem Unterordner in $Dirtosub wird beim zweiten Umlauf (Zeile 16) kein Ordner mehr gefunden.
    Würde ich mal vermuten. 8)

  • GUI erstellen aber mit wenig Code.

    • nuts
    • 2. September 2009 um 10:35

    Dabei werden 100 Stück erstellt :)

    In Zeile 4 werden eben die relevaten Daten fürs Label errechnet (in Abhängigkeit von $i)

    Int & Mod werden mit der Hilfe nicht klar?

    Je nach Anforderung wirds einfacher:

    Spoiler anzeigen
    [autoit]


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

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

    Opt("GUICoordMode", 1)
    Global $HA = @DesktopHeight -200
    Global $VA = @DesktopWidth -800

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

    #Region HauptGUI
    Global $binfo = "Aktiviere DVB Viewer|Aktiviere Tastatur|Aktiviere Winamp|Aktiviere PowerDVD|Devcon|Anwendungs-Stop|Auflösungen|Shutdown|Reboot|Standby|Exit" ;Buttonbeschriftung für jeden Button mit | getrennt eingeben -> Anzahl der Beschriftungen bestimmt gleichzeitig die Anzahl der Buttons
    Global $abfinfo = StringSplit($binfo, '|')
    Global $banzahl = $abfinfo[0]
    Global $babstandleft = 50 ;Abstand links und rechts zur HauptGUI
    Global $babstandtop = 10 ;Abstand zwischen den Buttons
    Global $bwidth = $VA - 2* $babstandleft ;Button Left ausrechnen
    Global $bheight = $HA / $banzahl - $babstandtop* ($banzahl +1) / $banzahl ;Button Höhe in Abhängigkeit zur Auflösung ausrechnen
    Global $HauptGUI = GUICreate("HTPC", $VA, $HA, -1, -1)

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

    ;Buttons erstellen und Button TOP ausrechnen
    For $i = 1 to $banzahl
    Global $Button = GUICtrlCreateButton($abfinfo[$i], $babstandleft, $i*$babstandtop+ ($i -1)* $bheight, $bwidth, $bheight,$BS_BITMAP )
    GUICtrlSetFont(-1, 20)
    next
    #EndRegion HauptGUI

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

    GUISetState(@SW_SHOW, $HauptGUI)

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

    While 1

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

    $msg = GUIGetMsg()
    switch $msg
    case $GUI_EVENT_Close
    Exit
    EndSwitch
    WEnd

    [/autoit]
  • Abfangen der Enter-Taste beim Input-Control

    • nuts
    • 2. September 2009 um 10:24

    Hey,

    folgendes Problem: Ich habe eine Eingabemaske, bestehend aus mehreren Inputfeldern.
    Sobald man mit Enter die Eingabe bestättigt sollen verschiedene Funktionen aufgerufen werden (Inhalt prüfen, zum nächsten springen usw.)

    Leider bereiten mir die Methoden zum Abfangen der Messagecodes in Verbindung mit der Enter-Taste Probleme :(
    Hier mal ein Skript:

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <GuiImageList.au3>
    #include <GUIListView.au3>

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

    #include <GUIConstantsEx.au3>
    #include <ListViewConstants.au3>
    #include <EditConstants.au3>
    #include <WindowsConstants.au3>
    #include <File.au3>
    #include <ComboConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 633, 447, 193, 125)
    $Input1 = GUICtrlCreateInput("Input1", 144, 48, 177, 21)
    $hWndi1 = GUICtrlGetHandle($Input1)
    $Input2 = GUICtrlCreateInput("Input2", 144, 96, 177, 21)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
    GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    WEnd

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

    Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    ConsoleWrite("message=" & $hWnd & @CRLF & $iMsg & @CRLF & $iwParam & @CRLF & $ilParam)
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo
    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    ConsoleWrite("icode=" & $iCode & @CRLF)
    ConsoleWrite("iIDForm=" & $iIDFrom & @CRLF)
    ConsoleWrite("hwnd=" & $hWndFrom & @CRLF)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_NOTIFY

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

    Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    Local $hWndFrom, $iIDFrom, $iCode, $hWndEdit
    $hWndFrom = $ilParam
    $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
    $iCode = BitShift($iwParam, 16)
    ConsoleWrite("iIParam=" & $hWndFrom & @CRLF)
    ConsoleWrite("iIDForm=" & $iIDFrom & @CRLF)
    ConsoleWrite("icode=" & $iCode & @CRLF)
    Switch $iIDFrom
    Case $Input1
    Switch $iCode
    Case 0 ; $icode für Enter?
    MsgBox(1, "Input1", "WM_Command")
    EndSwitch
    case $Input2
    Switch $iCode
    Case 0 ; $icode für Enter?
    MsgBox(1, "Input2", "WM_Command")
    EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_COMMAND

    [/autoit]

    Nach langem Suchen in den includes meine ich das richtige gefunden zu haben (aus der Structureconstants.au3):

    [autoit]


    ; #STRUCTURE# ===================================================================================================================
    ; Name...........: $tagNMCBEENDEDIT
    ; Description ...: Contains information about the conclusion of an edit operation within a ComboBoxEx control
    ; Fields ........: $tagNMHDR - Contains information about a notification message
    ; fChanged - Indicating whether the contents of the control's edit box have changed
    ; NewSelection - The zero-based index of the item that will be selected after completing the edit operation
    ; +This value can be $CB_ERR if no item will be selected
    ; Text - A zero-terminated string that contains the text from within the control's edit box
    ; Why - The action that generated the $CBEN_ENDEDIT notification message
    ; +This value can be one of the following:
    ; |$CBENF_DROPDOWN - The user activated the drop-down list
    ; |$CBENF_ESCAPE - The user pressed ESC
    ; |$CBENF_KILLFOCUS - The edit box lost the keyboard focus
    ; |$CBENF_RETURN - The user completed the edit operation by pressing ENTER
    ; Author ........: Gary Frost (gafrost)
    ; Remarks .......:
    ; ===============================================================================================================================
    Global Const $tagNMCBEENDEDIT = $tagNMHDR & ";int fChanged;int NewSelection;char Text[1024];int Why"

    [/autoit]

    Nur leider klappt die Umsetzung nicht, $WM_Notify liefert gar nichts und $WM_Command liefert (s. Skript)

    iIParam=0x00000000
    iIDForm=1
    icode=0

    ?(

    Vielleicht hat ja jemand einen Tipp für mich?

    Gruß nuts

    edit \ Hab oben ein $WM_Command Lösung editiert.
    Mit der Struktur kämpfe ich noch :wacko:

  • Probleme mit InputBox-Rückgabewerten

    • nuts
    • 1. September 2009 um 22:12

    Genau :thumbup:

  • Probleme mit InputBox-Rückgabewerten

    • nuts
    • 1. September 2009 um 22:04
    Zitat


    Return Value

    Success: Returns the string that was entered.
    Failure: Returns "" (blank string) and sets @error as follows:
    @Error 0 = The string returned is valid.
    1 = The Cancel button was pushed.
    2 = The Timeout time was reached.
    3 = The InputBox failed to open. This is usually caused by bad arguments.

    Alles anzeigen


    Aus der Hilfe zur Inputbox. ;)

  • Probleme mit InputBox-Rückgabewerten

    • nuts
    • 1. September 2009 um 20:58
    [autoit]


    $name1=InputBox("Eingabe","Wie heißt du?",""," M")
    If @error =1 Then
    _beenden()
    EndIf

    [/autoit]

    So gehts. 8)

  • Variablen zwischen 2 Scripten

    • nuts
    • 1. September 2009 um 20:46

    Im englischen Forum ist doch ein Beispiel:

    Spoiler anzeigen
    [autoit]


    ;Script1
    #include "MessageHandler.au3"

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

    $Local_ReceiverID_Name = "Script1sReceiverID";This is the ID that the other script will use to send data
    $Remote_ReceiverID_Name = "Script2sReceiverID";This is the ID of the script we want to send data too

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

    $hwnd = _SetAsReceiver($Local_ReceiverID_Name)
    ConsoleWrite("hwnd of the Local_ReceiverID_Name is " & $hwnd & @crlf)
    $myFunc = _SetReceiverFunction("_MyFunc2")
    ConsoleWrite("My data receiver function is " & $myFunc & @crlf)

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

    While 1
    Sleep(1000)
    WEnd

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

    Func _MyFunc2($vText)
    Msgbox(0,@ScriptName,"I am " & @ScriptName & " I have received some data" & @crlf & @crlf & $vText & @crlf & @crlf & "And now I'm sending the data back")
    $iSent = _SendData($vText,$Remote_ReceiverID_Name)
    Exit
    EndFunc

    [/autoit]
    Spoiler anzeigen
    [autoit]


    ;Script2
    #include "MessageHandler.au3"

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

    $Local_ReceiverID_Name = "Script2sReceiverID";This is the ID that the other script will use to send data
    $Remote_ReceiverID_Name = "Script1sReceiverID";This is the ID of the script we want to send data too

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

    $hwnd = _SetAsReceiver($Local_ReceiverID_Name)
    ConsoleWrite("hwnd of the Local_ReceiverID_Name is " & $hwnd & @crlf)
    $myFunc = _SetReceiverFunction("_MyFunc2")
    ConsoleWrite("My data receiver function is " & $myFunc & @crlf)

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

    $Str = InputBox(@ScriptName," I am " & @ScriptName & @crlf & "Enter some data to be sent to the other script")

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

    $iSent = _SendData($Str,$Remote_ReceiverID_Name)

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

    While 1
    sleep(100)
    WEnd

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

    Func _MyFunc2($vText)
    Msgbox(0,@ScriptName,@ScriptName & " has received a message" & @crlf & $vText)
    Exit
    EndFunc

    [/autoit]

    Beide radikal gekürzt:

    Empfänger:

    Spoiler anzeigen
    [autoit]


    ;Script1
    #include "MessageHandler.au3"

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

    $Local_ReceiverID_Name = "Script1sReceiverID";This is the ID that the other script will use to send data

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

    $hwnd = _SetAsReceiver($Local_ReceiverID_Name)
    $myFunc = _SetReceiverFunction("_MyFunc2")

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

    While 1
    Sleep(1000)
    WEnd

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

    Func _MyFunc2($vText)
    Msgbox(0,""," Ich bin der Empfänger und habe folgende Nachricht empfangen" & @crlf & @crlf & $vText)
    Exit
    EndFunc

    [/autoit]

    Sender:

    Spoiler anzeigen
    [autoit]


    ;Script2
    #include "MessageHandler.au3"

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

    $Local_ReceiverID_Name = "Script2sReceiverID";This is the ID that the other script will use to send data
    $Remote_ReceiverID_Name = "Script1sReceiverID";This is the ID of the script we want to send data too

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

    $hwnd = _SetAsReceiver($Local_ReceiverID_Name)

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

    $Str = InputBox(""," Ich bin der Sender "& @crlf & "Bitte Nachricht zum Senden eingeben")

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

    $iSent = _SendData($Str,$Remote_ReceiverID_Name)

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

    While 1
    sleep(100)
    WEnd

    [/autoit]
  • Dreckgenerator

    • nuts
    • 1. September 2009 um 16:46

    Du musst Fileopen im Lesemodus (0) verwenden.

  • Dreckgenerator

    • nuts
    • 1. September 2009 um 16:28
    [autoit]


    $1 = "Ich wollte ein AutoIt script schreiben" ;.txt Dateien können mit Fileread, Filereadline oder _Filereadtoarray eingelesen werden -> s. Hilfe
    $2 = "was auf 4 textdateien jeweils ein Wort rausnimmt"
    $3 = "und diese in einem satz anordnet"
    $4 = "in einer textbox anziegen"

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

    $a1 = stringsplit($1, " ")
    $r1 = Random(1, ubound($a1))

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

    $a2 = stringsplit($2, " ")
    $r2 = Random(1, ubound($a2))

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

    $a3 = stringsplit($3, " ")
    $r3 = Random(1, ubound($a3))

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

    $a4 = stringsplit($4, " ")
    $r4 = Random(1, ubound($a4))

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

    MsgBox(1, "", $a1[$r1] & " " & $a2[$r2] & " " & $a3[$r3] & " " & $a4[$r4])

    [/autoit]

    :D

  • random+gui

    • nuts
    • 1. September 2009 um 13:07

    In beiden Fällen stimmen einfach die Pfade zu den Bildern nicht.
    Gib beim Beispiel von anno2008 den Ordner mit den Bilddateien an (in der Funktion _FileListtoArray) und bei meinem den richtigen Pfad (bei $apic[0] bis $apic[2]) zu den jeweiligen Bildern.

  • Mathematisches Problem IParam-Speicherung

    • nuts
    • 1. September 2009 um 10:45

    Also du hast einen X-Bereich von 0-29 und einen Y-Bereich von -1 bis - Integer und suchst eine Umrechnung von Y -> X ?

  • Variablen zwischen 2 Scripten

    • nuts
    • 31. August 2009 um 21:42

    Hehe das ist ja easy, danke :D

  • Notenmanager, Schulnoten verwalten, Schnitte ausrechnen und mehr...Version 3.20

    • nuts
    • 31. August 2009 um 21:14

    Also mit dem Skript habe ich die gleichen Probleme. Der Quellcode ist echt gruselig :D möglicherweise ausversehen eine falsche Version hochgeladen?

  • Handbuch?

    • nuts
    • 31. August 2009 um 20:56

    http://translation.autoit.de/hilfe.php
    [ gelöst ] Buch
    http://wiki.autoit.de/wiki/index.php/Tutorial

    Da sollte doch was dabei sein :)

  • Mausklick auf einer stelle simulieren

    • nuts
    • 31. August 2009 um 18:06

    Naja so ein mächtiger Virus wirds schon nicht werden. :D

    Wozu man immer wieder auf die selbe Stelle klicken sollte verstehe ich aber auch nicht.

  • MP3-Double-Finder

    • nuts
    • 31. August 2009 um 18:04

    Ohje 1/3 ist bei mir doppelt im System :rolleyes:

    Besonders interessiet hat mich die Funktion _RecursiveFileListToArray.
    Davon gibt es ja zahlreiche Varianten, ist das die deiner Meinung nach schnellste?
    Was wäre eine geeignete Methode um verschiedene Funktionen gegeneinander antreten zu lassen?

  • Variablen zwischen 2 Scripten

    • nuts
    • 31. August 2009 um 17:39

    Kriegen wir dazu ein Beispiel? So ganz ist mir das jetzt auch nicht klar. ?(

    @Frage: Was spricht gegen die $WM_COPYDATA Lösung?

  • Mausklick auf einer stelle simulieren

    • nuts
    • 31. August 2009 um 17:28

    Na hör mal, hast du wenigstens versucht die Hilfe zu lesen?

    [autoit]


    MouseClick("left", 1275, 5) ; Die Kooardinaten zeigt dir wie gesagt das Autoit Infotool an

    [/autoit]


    So irgendwie :(

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™