Fragen zu: Liste erstellen aus Datei, Daten änder oder löschen. Inhalt auslesen. Fixierte Spaltenbreite

  • Hi!

    Ich hab schon die Suchfunktion benutzt, aber irgendwie ist kein ein passendes Ergebnis für mich dabei.

    Also, ich habe eine Textdatei, wo mehrere Daten in Textform drin stehen. Alle Daten sind per Absatz von einander getrennt. Also

    Code
    Daten in Zeile 1
    Daten in Zeile 2
    Daten in Zeile 3; sollen beispielsweise gleich ausgelesen werden
    Daten in Zeile 4
    [...]

    Diese Datei heißt z.B.: Datei.txt. Hierzu dann der Code:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #Include <File.au3>
    #include <GuiListView.au3>

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

    $Daten= ("Datei.txt")
    Global $ar
    If Not FileExists($Daten) Then Exit MsgBox(16,"","Datei nicht gefunden!"&@CRLF&$Daten)
    _FileReadToArray($Daten, $ar)
    If @error Then Exit MsgBox(16,"","Fehler beim Lesen mit FileReadToArray!")

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

    $GUIList = GuiCreate("Liste", 750,550, -1, -1)
    $Exit = GUICtrlCreateButton("Verlassen", 650, 510, 80, 25)
    $list = GUICtrlCreateListView("Hier stehen die ganzen Daten aus Datei.txt drin:", 9, 140, 728, 361, $LVS_EDITLABELS)
    _GUICtrlListView_SetView($list, 0)

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

    For $i = 1 To $ar[0]
    GUICtrlCreateListViewItem($ar[$i],$list)
    Next

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

    GUISetState()

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

    while 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $Exit
    GUIDelete()
    ExitLoop
    Case $msg = $GUI_EVENT_CLOSE
    GUIDelete()
    ExitLoop
    EndSelect
    WEnd

    [/autoit]


    Also soweit bin ich schon, dass ich die Daten richtig anzeigen lassen kann.
    Nun zu den Fragen.

    1)
    Also es ist ja nur eine Spalte vorhanden, die Bezeichnung wird aber nach 25 Zeichen mit [...] abgekürzt. Der Inhalt wird demnach auch abgekürzt. Wie kann man die Spaltenbreite auf die Listenbreite (hier: 750) definieren, (auch wenn ich bei $list die Breite auf 140 einstelle, wird es gekürzt)

    2)
    $LVS_EDITLABELS habe ich integriert um die einzelnen Daten in der Liste editieren zu können. Wie kann man das machen, dass wenn ich einen Wert unbenannt hab, dass dieser dann automatisch so in die Datei.txt reingeschrieben wird? (aktuell hat das unbenennen keinen Effekt, es wird automatisch der alte Wert wieder angenommen)

    3)
    Wie kann ich mir mit meiner Methode einen ganz bestimmten Wert anzeigen lassen? Also wenn ich z.B. Zeile 3 anklicke und danach auf einen Button, der mir den Wert als MsgBox ausgibt sollte in der Mitteilung stehen: "Daten in Zeile 3; sollen beispielsweise gleich ausgelesen werden"

    4)
    Kann ich einen bestimmte Zeile aus der Tabelle per Taste Entf oder per einen Button löschen, ohne dass dort eine Text-freie Stelle bleibt?

    5)
    Ist es Möglich den Hintergrund dieser Liste Transparent darzustellen? Hab es mit GUICtrlSetBkColor($list, $GUI_BKCOLOR_TRANSPARENT) versucht, aber da kommt dann nur ein Schwarzer Hintergrund :(


    Gibt es Elegantere oder Einfachere Möglichkeiten Listen darzustellen, als meine oben?

    Per Suchfunktion fand ich so etwas ähnliches:

    Spoiler anzeigen
    [autoit]

    #include <GuiConstantsEx.au3>
    #include <GuiListBox.au3>
    $GUI = GUICreate("Items einfärben",400,200)
    GUISetState()
    Dim $Array[3]
    $Array[0] = "Test1"
    $Array[1] = "Test2"
    $Array[2] = "Test3"

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

    $List = _GUICtrlListBox_Create($GUI,"",0,0,400,200)
    For $i = 0 to Ubound($Array,1)-1
    _GUICtrlListBox_AddString($List,$Array[$i])
    Next
    Do
    $msg = GUIGetMsg()
    Until $msg = -3

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

    Mit Arrays (weiß noch nichtmal richtig was das ist, nur das es eine Art Tabelle ist) kenn ich mich allerdings noch so gut wie garnicht aus.


    Hoffe jemand kann mir helfen :)

    mfg Henry

    Einmal editiert, zuletzt von Henry (21. Juni 2009 um 17:07)

  • Hallo Henry,

    zu 1) hier kannst du _GuiCtrlListView_SetColumnWidth verwenden entweder mit einem fixen Wert oden dem Stil $LVSCW_AUTOSIZE

    [autoit]

    _GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE); erste Spalte automatische Breite

    [/autoit]


    zu 2) BugFix hat mal ein Beispiel gepostet bei dem man ListviewItems ändern kann, zum Speichern schau dir FileWriteLine an
    zu 3) _GUICtrlListView_GetItemText und _GUICtrlListView_GetSelectedIndices verwenden z.B.

    [autoit]

    $Sound = _GUICtrlListView_GetItemText($hListView1, _GUICtrlListView_GetSelectedIndices($hListView1, False), 1)

    [/autoit]

    (aus Troin's Thread Post von Progandy)
    zu 4) schau dir _GUICtrlListView_DeleteItem in der Hilfe an
    zu 5) kA (zumindest nicht wie es ohne ChildGui funktioniert)

    Arrays können einem die Tipp-Arbeit sehr erleichtern und reduzieren dadurch auch mögliche Tipp-Fehler, dass du die für eine ListView und nicht für eine ListBox entschieden hast ist gut, da die Listview mehr Möglichkeiten bietet,

    mfg (Auti)Bert

  • hi!

    also das Problem 1) konnte ich lösen!
    Mit $LVSCW_AUTOSIZE ging das aber nicht, ich musste $LVSCW_AUTOSIZE_USEHEADER verwenden, aber das wusste ich dann schnell.

    Problem 3) und Problem 4) mache jetzt auch keine Probleme mehr :)

    Nur das Ändern und anschließende schreiben muss ich noch etwas rumprobieren. (Problem 2) Aber das mache ich morgen. Gehe jetzt erstmal schlafen =)

    Problem 5) ist erstmal nebensache, da ich die Listen jetzt so eingefärbt hab, dass jeder 2. Eintrag ne etwas andere Farbe hat ( wechselt dann immer von weiß nach hellgrau -> weiß -> hellgrau usw. Dadurch sieht das ganze dann richtig gut aus.

    [autoit]

    #include <GUIConstantsEx.au3>
    #Include <File.au3>
    #include <GuiListView.au3>

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

    $Daten= ("Datei.txt")
    Global $ar
    If Not FileExists($Daten) Then Exit MsgBox(16,"","Datei nicht gefunden!"&@CRLF&$Daten)
    _FileReadToArray($Daten, $ar)
    If @error Then Exit MsgBox(16,"","Fehler beim Lesen mit FileReadToArray!")

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

    $GUIList = GuiCreate("Liste", 750,550, -1, -1)
    $Delete = GUICtrlCreateButton("Löschen", 550, 510, 80, 25)
    $Google = GUICtrlCreateButton("Google", 450, 510, 80, 25)
    $Exit = GUICtrlCreateButton("Verlassen", 650, 510, 80, 25)
    $list = GUICtrlCreateListView("Hier stehen die ganzen Daten aus Datei.txt drin:", 9, 140, 728, 361, $LVS_EDITLABELS)
    _GUICtrlListView_SetView($list, 0)
    GUICtrlSetBkColor($list, 0xF2F2F2)
    GUICtrlSetBkColor($list, $GUI_BKCOLOR_LV_ALTERNATE)
    _GUICtrlListView_SetColumnWidth($list , 0,$LVSCW_AUTOSIZE_USEHEADER)

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

    For $i = 1 To $ar[0]
    GUICtrlCreateListViewItem($ar[$i],$list)
    GUICtrlSetBkColor(-1,0xE5E5E5)
    Next

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

    GUISetState()

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

    while 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $Delete
    _GUICtrlListView_DeleteItemsSelected($list)
    Case $msg = $Google
    $number = _GUICtrlListView_GetSelectedIndices($list)
    $number = $number+0
    $seonline = _GUICtrlListView_GetItemText($list, $number)
    _IECreate ("http://www.google.de/search?hl=de&q="& $seonline, 1, 1, 0)
    Case $msg = $Exit
    GUIDelete()
    ExitLoop
    Case $msg = $GUI_EVENT_CLOSE
    GUIDelete()
    ExitLoop
    EndSelect
    WEnd

    [/autoit]

    Was mich wundert ist, dass ich die Variable $number noch um 0 erhöhen muss, weil sonst der Wert nicht richtig erkannt wird.. -> $number = $number+0

    Naja. Danke für die Hilfe bis jetzt :)

    mfg Henry

    PS: Falls jemand weiß, wie man Problem 2) lösen kann, wäre ich für Beispiele an meinem Code oben, sehr dankbar! Dann erspare ich mir viel rumprobieren, bis es klappt^^

  • hi!

    Hinzufügen von Daten geht und löschen auch :) . Nur das ändern krieg ich nicht richtig hin :(

    Das Beispiel in der Hilfe Datei ist irgendwie so riesig. Da blick ich nicht richtig durch: Function _GUICtrlListView_EditLabel_GUICtrlListView_EditLabel

    Spoiler anzeigen
    [autoit]

    #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    #include <GuiConstantsEx.au3>
    #include <GuiListView.au3>
    #include <GuiImageList.au3>
    #include <WindowsConstants.au3>

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

    Opt('MustDeclareVars', 1)

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

    $Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work

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

    Global $hListView

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

    _Main()

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

    Func _Main()
    Local $hImage

    GUICreate("ListView Edit Label", 400, 300)
    $hListView = GUICtrlCreateListView("", 2, 2, 394, 268, BitOR($LVS_EDITLABELS, $LVS_REPORT))
    _GUICtrlListView_SetUnicodeFormat($hListView, False)
    GUISetState()

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

    ; Load images
    $hImage = _GUIImageList_Create()
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))
    _GUICtrlListView_SetImageList($hListView, $hImage, 1)

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

    ; Add columns
    _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
    _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
    _GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)

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

    ; Add items
    _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)
    _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
    _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2)
    _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
    _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1)
    _GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)

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

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

    ; Edit item 0 label with time out
    _GUICtrlListView_EditLabel($hListView, 0)

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

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
    EndFunc ;==>_Main

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

    Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
    $hWndListView = $hListView
    If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)

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

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
    Case $hWndListView
    Switch $iCode
    Case $LVN_BEGINLABELEDIT, $LVN_BEGINLABELEDITW ; Start of label editing for an item
    $tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
    _DebugPrint("$LVN_BEGINLABELEDIT" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode & @LF & _
    "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
    "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
    "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
    "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
    "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
    "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
    "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
    "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
    "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
    "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
    "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
    Return False ; Allow the user to edit the label
    ;Return True ; Prevent the user from editing the label
    Case $LVN_COLUMNCLICK ; A column was clicked
    $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
    _DebugPrint("$LVN_COLUMNCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode & @LF & _
    "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
    "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
    "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
    "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
    "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
    "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
    "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
    "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
    ; No return value
    Case $LVN_DELETEITEM ; An item is about to be deleted
    $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
    _DebugPrint("$LVN_DELETEITEM" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode & @LF & _
    "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
    "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
    "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
    "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
    "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
    "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
    "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
    "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
    ; No return value
    Case $LVN_ENDLABELEDIT, $LVN_ENDLABELEDITW ; The end of label editing for an item
    $tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
    Local $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
    _DebugPrint("$LVN_ENDLABELEDIT" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode & @LF & _
    "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
    "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
    "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
    "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
    "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
    "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
    "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
    "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
    "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
    "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
    "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
    "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
    "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
    ; If Text is not empty, return True to set the item's label to the edited text, return false to reject it
    ; If Text is empty the return value is ignored
    If StringLen(DllStructGetData($tBuffer, "Text")) Then Return True
    Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
    _DebugPrint("$NM_CLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode & @LF & _
    "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
    "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
    "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
    "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
    "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
    "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
    "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
    "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
    "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
    ; No return value
    Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
    _DebugPrint("$NM_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode & @LF & _
    "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
    "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
    "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
    "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
    "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
    "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
    "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
    "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
    "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
    ; No return value
    Case $NM_KILLFOCUS ; The control has lost the input focus
    _DebugPrint("$NM_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode)
    ; No return value
    Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button
    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
    _DebugPrint("$NM_RCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode & @LF & _
    "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
    "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
    "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
    "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
    "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
    "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
    "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
    "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
    "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
    ;Return 1 ; not to allow the default processing
    Return 0 ; allow the default processing
    Case $NM_RDBLCLK ; Sent by a list-view control when the user double-clicks an item with the right mouse button
    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
    _DebugPrint("$NM_RDBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode & @LF & _
    "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
    "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
    "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
    "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
    "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
    "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
    "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
    "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
    "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
    ; No return value
    Case $NM_RETURN ; The control has the input focus and that the user has pressed the ENTER key
    _DebugPrint("$NM_RETURN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode)
    ; No return value
    Case $NM_SETFOCUS ; The control has received the input focus
    _DebugPrint("$NM_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
    "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
    "-->Code:" & @TAB & $iCode)
    ; No return value
    EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_NOTIFY

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

    Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
    "!===========================================================" & @LF & _
    "+======================================================" & @LF & _
    "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
    "+======================================================" & @LF)
    EndFunc ;==>_DebugPrint

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

    Diese Ausgabe in der Console, Kontext Menü beim Editieren und sonstigen Schnick-Schnack brauch ich ja garnicht. :|

    Weiß jemand wie das geht, ohne dieses ganze Debugprint, Kontextmenü usw ?

    mfg Henry

  • Hallo Henry,

    2 Beiträge innerhalb von 12 Stunden ohne dass ein anderer Post dazwischen war grenzt schon stark an pushen, dieses wird hier nicht so gerne gesehen denn man kein seinen eigenen Beitrag auch bearbeiten. (Dies als Hinweis)
    Back to Topic: schau dir mal diesen Beitrag von @ BugFix an, darin zeigt er eine Lösung.

    mfg (Auto)bert

  • Hi!

    02:15 war einer und der nächste um
    14:09

    Also 11:56 Stunden -> ok, hast recht innerhalb von 12 Stunden 2 Beiträge.

    Die Lösung von BugFix funktioniert super. Hatte sie nicht gefunden.(falsches Forum durchsucht)

    mfg Henry