Ordner Read

    • Offizieller Beitrag

    Habe es gefunden,
    du hast zwar den ItemIndex ausgelesen, aber keiner weiterverarbeitenden Variablen zugewiesen.

    [autoit]

    Func _SHLV_WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo, $hListView1 = $SHELLLISTVIEWHANDLE

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

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
    Case $hListView1
    Local $nIndex = -2
    Switch $iCode
    Case $NM_RETURN
    ConsoleWrite("jkjkjkjkjl hj lu" & @CRLF)
    $nIndex = _GUICtrlListView_GetSelectedIndices($hListView1,True)
    If IsArray($nIndex) And $nIndex[0]=1 Then
    $nIndex = $nIndex[1]
    ContinueCase
    EndIf
    Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
    If $nIndex = -2 Then
    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
    $nIndex = DllStructGetData($tInfo, "Index") ; "$nIndex =" fehlte ! ####################
    EndIf

    [/autoit]
    • Offizieller Beitrag

    Probier mal das:

    Spoiler anzeigen
    [autoit]

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

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

    #include <GUIConstantsEx.au3>
    #include <ListViewConstants.au3>
    #include <EditConstants.au3>
    #include <WindowsConstants.au3>
    #include <Constants.au3>

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

    Global Const $tagSHFILEINFO = "dword hIcon; int iIcon; DWORD dwAttributes; CHAR szDisplayName[255]; CHAR szTypeName[80];"
    Global Const $SHGFI_USEFILEATTRIBUTES = 0x10
    Global Const $SHGFI_SYSICONINDEX = 0x4000
    ;~ Global Const $FILE_ATTRIBUTE_NORMAL = 0x80
    Global Const $SHGFI_SMALLICON = 0x1
    Global Const $SHGFI_LARGEICON = 0x0

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

    Global Const $FOLDERUP_ICON_INDEX = _GUIImageList_AddIcon(_GUIImageList_GetSystemImageList(), @SystemDir&"\shell32.dll", 132)
    Global Const $FOLDER_ICON_INDEX = _GUIImageList_GetFileIconIndex(@SystemDir, 0, 1)
    Global Const $NOICON_ICON_INDEX = _GUIImageList_GetFileIconIndex("nb lgl", 0, 0)

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

    Opt("GUIOnEventMode", 1)
    #Region ### START Koda GUI section ### Form=D:\Dokumente\Dateien von Andreas\AutoIt3\FTP\GUI_MAIN.kxf
    Global $GUI_MAIN = GUICreate("Au3FTP", 882, 586, 193, 125)
    GUISetOnEvent(-3,"GUI_Close")

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

    Global $inpLocalDirectory = GUICtrlCreateInput("", 8, 28, 369, 20, $ES_READONLY)
    Global $ListView1 = GUICtrlCreateListView("Name|Datum|Größe", 8, 48, 369, 489)
    Global $hListView1 = GUICtrlGetHandle($ListView1)
    Global $SHELLLISTVIEWHANDLE = GUICtrlGetHandle($ListView1) ; Get the Handle

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

    GUICtrlSendMsg($ListView1, 0x101E, 0, 200)
    GUICtrlSendMsg($ListView1, 0x101E, 1, 75)
    GUICtrlSendMsg($ListView1, 0x101E, 2, 50)
    GUIRegisterMsg($WM_NOTIFY, "_SHLV_WM_NOTIFY")

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

    _GUICtrlListView_SetImageList($ListView1, _GUIImageList_GetSystemImageList(), 1)
    Global $DIRECTORY_LOCAL = "" ; Start with Selection of drives (IMG:http://www.autoitscript.com/forum/style_em…utoit/smile.gif)
    _SHLV_PopulateLocalListView($SHELLLISTVIEWHANDLE,$DIRECTORY_LOCAL)
    Global Const $_ListView_AllowEnter_WindowProcHandle = DllCallbackRegister("_ListView_AllowEnter_WindowProc", "lresult", "hwnd;uint;wparam;lparam")
    Global Const $_HLISTVIEW_wProcOld = _WinAPI_SetWindowLong($hListView1, $GWL_WNDPROC, DllCallbackGetPtr($_ListView_AllowEnter_WindowProcHandle))

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    Sleep(100)
    WEnd

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

    Func _ListView_AllowEnter_WindowProc($hWnd, $Msg, $wParam, $lParam)
    If $hWnd=$hListView1 And $Msg=$WM_GETDLGCODE And $wParam=0x0D Then Return 0x4 ;$DLGC_WANTALLKEYS
    Return _WinAPI_CallWindowProc($_HLISTVIEW_wProcOld, $hWnd, $Msg, $wParam, $lParam)
    EndFunc

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

    Func GUI_Close()
    _WinAPI_SetWindowLong($hListView1, $GWL_WNDPROC, $_HLISTVIEW_wProcOld)
    Exit
    EndFunc
    Func OnAutoItExit()
    DllCallbackFree($_ListView_AllowEnter_WindowProcHandle)
    EndFunc

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

    ; Prog@ndy
    Func _SHLV_PopulateLocalListView($hListView1,ByRef $DIRECTORY_LOCAL)
    If Not IsHWnd($hListView1) Then $hListView1 = GUICtrlGetHandle($hListView1)
    If $DIRECTORY_LOCAL = "" Then
    Local $drives = DriveGetDrive("ALL")
    GUICtrlSetData($inpLocalDirectory, "Drive Selection")
    _GUICtrlListView_BeginUpdate($hListView1)
    _GUICtrlListView_DeleteAllItems($hListView1)
    For $i = 1 To $drives[0]
    _GUICtrlListView_AddItem($hListView1, StringUpper($drives[$i]) & "\", _GUIImageList_GetFileIconIndex($drives[$i] & "\"))
    Next
    _GUICtrlListView_EndUpdate($hListView1)
    Return
    EndIf
    If StringRight($DIRECTORY_LOCAL, 1) <> "\" Then $DIRECTORY_LOCAL &= "\"
    If DriveStatus(StringLeft($DIRECTORY_LOCAL, 3)) <> "READY" Then Return 0 * MsgBox(16 + 8192, 'Error on Drive Access', "Drive " & StringLeft($DIRECTORY_LOCAL, 3) & " not ready!")
    GUICtrlSetData($inpLocalDirectory, $DIRECTORY_LOCAL)
    $files = _SHLV__FileListToArray2($DIRECTORY_LOCAL, "*.*", 2)
    _GUICtrlListView_BeginUpdate($hListView1)
    _GUICtrlListView_DeleteAllItems($hListView1)
    Local $foldercount = 0
    _GUICtrlListView_AddItem($hListView1, "< .. >", $FOLDERUP_ICON_INDEX)
    If IsArray($files) Then
    _GUICtrlListView_SetItemCount($hListView1,$files[0]+1)
    $foldercount = $files[0]+1
    For $i = 1 To $files[0]
    $item = _GUICtrlListView_AddItem($hListView1, $files[$i], $FOLDER_ICON_INDEX)
    _GUICtrlListView_AddSubItem($hListView1, $item, __SHLV_FormatFilesize(DirGetSize($DIRECTORY_LOCAL & $files[$i], 2)), 2)
    Next
    EndIf
    $files = _SHLV__FileListToArray2($DIRECTORY_LOCAL, "*.*", 1)
    _GUICtrlListView_EndUpdate($hListView1)
    _GUICtrlListView_BeginUpdate($hListView1)
    If IsArray($files) Then
    _GUICtrlListView_SetItemCount($hListView1,$files[0]+$foldercount)
    For $i = 1 To $files[0]
    $item = _GUICtrlListView_AddItem($hListView1, $files[$i], _GUIImageList_GetFileIconIndex($files[$i]))
    _GUICtrlListView_AddSubItem($hListView1, $item, __SHLV_FileDateString2Calc(FileGetTime($DIRECTORY_LOCAL & $files[$i], 0, 1)), 1)
    _GUICtrlListView_AddSubItem($hListView1, $item, __SHLV_FormatFilesize(FileGetSize($DIRECTORY_LOCAL & $files[$i])), 2)
    Next
    EndIf
    _GUICtrlListView_EndUpdate($hListView1)
    EndFunc ;==>_SHLV_PopulateLocalListView

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

    ; Prog@ndy
    Func __SHLV_FormatFilesize($size)
    Select
    Case $size > 1000
    Return Round($size / 1024, 1) & " KB"
    Case $size > 1048500
    Return Round($size / 1048576, 1) & " MB"
    Case Else
    Return $size & " Byte"
    EndSelect
    EndFunc ;==>_FormatFilesize

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

    ; Prog@ndy
    Func _GUIImageList_GetSystemImageList($bLargeIcons = False)
    Local $dwFlags, $hIml, $FileInfo = DllStructCreate($tagSHFILEINFO)

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

    $dwFlags = BitOR($SHGFI_USEFILEATTRIBUTES, $SHGFI_SYSICONINDEX)
    If Not ($bLargeIcons) Then
    $dwFlags = BitOR($dwFlags, $SHGFI_SMALLICON)
    EndIf

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

    ;~ '// Load the image list - use an arbitrary file extension for the
    ;~ '// call to SHGetFileInfo (we don't want to touch the disk, so use
    ;~ '// FILE_ATTRIBUTE_NORMAL && SHGFI_USEFILEATTRIBUTES).
    $hIml = _WinAPI_SHGetFileInfo(".txt", $FILE_ATTRIBUTE_NORMAL, _
    DllStructGetPtr($FileInfo), DllStructGetSize($FileInfo), $dwFlags)

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

    Return $hIml
    EndFunc ;==>_GUIImageList_GetSystemImageList

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

    ; Prog@ndy
    Func _WinAPI_SHGetFileInfo($pszPath, $dwFileAttributes, $psfi, $cbFileInfo, $uFlags)
    Local $return = DllCall("shell32.dll", "DWORD*", "SHGetFileInfo", "str", $pszPath, "DWORD", $dwFileAttributes, "ptr", $psfi, "UINT", $cbFileInfo, "UINT", $uFlags)
    If @error Then Return SetError(@error, 0, 0)
    Return $return[0]
    EndFunc ;==>_WinAPI_SHGetFileInfo

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

    ; Prog@ndy
    Func _GUIImageList_GetFileIconIndex($sFileSpec, $bLargeIcons = False, $bForceLoadFromDisk = False)
    Local $dwFlags, $FileInfo = DllStructCreate($tagSHFILEINFO)

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

    $dwFlags = $SHGFI_SYSICONINDEX
    If $bLargeIcons Then
    $dwFlags = BitOR($dwFlags, $SHGFI_LARGEICON)
    Else
    $dwFlags = BitOR($dwFlags, $SHGFI_SMALLICON)
    EndIf
    ;~ ' We choose whether to access the disk or not. If you don't
    ;~ ' hit the disk, you may get the wrong icon if the icon is
    ;~ ' not cached. But the speed is very good!
    If Not $bForceLoadFromDisk Then
    $dwFlags = BitOR($dwFlags, $SHGFI_USEFILEATTRIBUTES)
    EndIf

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

    ;~ ' sFileSpec can be any file. You can specify a
    ;~ ' file that does not exist and still get the
    ;~ ' icon, for example sFileSpec = "C:\PANTS.DOC"
    Local $lR = _WinAPI_SHGetFileInfo( _
    $sFileSpec, $FILE_ATTRIBUTE_NORMAL, DllStructGetPtr($FileInfo), DllStructGetSize($FileInfo), _
    $dwFlags _
    )

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

    If ($lR = 0) Then
    Return SetError(1, 0, -1)
    Else
    Return DllStructGetData($FileInfo, "iIcon")
    EndIf
    EndFunc ;==>_GUIImageList_GetFileIconIndex

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

    ; Author(s): Prog@ndy
    Func __SHLV_FileDateString2Calc($filedate)
    Return StringRegExpReplace($filedate, "(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})", "$1/$2/$3 $4:$5:$6")
    EndFunc ;==>_FileDateString2Calc
    ; Author(s): Prog@ndy
    Func __SHLV_CalcDate2FileDateString($calcdate)
    Return StringRegExpReplace($calcdate, "(\d{4})/(\d{2})/(\d{2}) (\d{2})(IMG:http://www.autoitscript.com/forum/style_em…/autoit/sad.gif) \d{2})(IMG:http://www.autoitscript.com/forum/style_em…/autoit/sad.gif) \d{2})", "$1$2$3$4$5$6")
    EndFunc ;==>_CalcDate2FileDateString

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

    ; Prog@ndy
    Func _SHLV_WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo, $hListView1 = $SHELLLISTVIEWHANDLE

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

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
    Case $hListView1
    Local $nIndex = -2
    Switch $iCode
    Case $NM_RETURN,$NM_DBLCLK
    ConsoleWrite("jkjkjkjkjl hj lu" & @CRLF)
    $nIndex = _GUICtrlListView_GetSelectedIndices($hListView1,True)
    If IsArray($nIndex) And $nIndex[0]=1 Then
    $nIndex = $nIndex[1]
    EndIf
    ConsoleWrite("11111" & @CRLF)
    If $nIndex = -2 Then
    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
    DllStructGetData($tInfo, "Index")
    EndIf
    ;~ _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"))
    Local $ItemText = _GUICtrlListView_GetItemText($hListView1, $nIndex, 0)
    If StringInStr(FileGetAttrib($DIRECTORY_LOCAL&$ItemText),"D") Then
    $DIRECTORY_LOCAL &= $ItemText
    _SHLV_PopulateLocalListView($ListView1,$DIRECTORY_LOCAL)
    ElseIf StringRegExp($ItemText, "\A[A-Za-z]:\\\Z") Then
    $DIRECTORY_LOCAL = $ItemText
    _SHLV_PopulateLocalListView($ListView1,$DIRECTORY_LOCAL)
    ElseIf $ItemText = "< .. >" Then
    Local $slash = StringInStr($DIRECTORY_LOCAL, "\", 1, -2)
    If $slash Then
    $DIRECTORY_LOCAL = StringLeft($DIRECTORY_LOCAL, $slash)
    ElseIf StringRegExp($DIRECTORY_LOCAL, "\A[A-Za-z]:\\\Z") Then
    $DIRECTORY_LOCAL = ""
    EndIf
    _SHLV_PopulateLocalListView($ListView1,$DIRECTORY_LOCAL)
    Else
    If MsgBox(36, "ShellListView", "Soll diese Datei geöffnet werden? " & @CRLF & $DIRECTORY_LOCAL&$ItemText) = 6 Then
    ShellExecute($DIRECTORY_LOCAL&$ItemText,"", $DIRECTORY_LOCAL)
    EndIf
    EndIf
    ; No return value
    EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_NOTIFY

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

    ; Author ........: SolidSnake <MetalGX91 at GMail dot com>
    ; Modified by Prog@ndy
    Func _SHLV__FileListToArray2($sPath, $sFilter = "*", $iFlag = 0)
    Local $hSearch, $sFile, $asFileList
    If Not FileExists($sPath) Then Return SetError(1, 1, "")
    If (StringInStr($sFilter, "\")) Or (StringInStr($sFilter, "/")) Or (StringInStr($sFilter, ":")) Or (StringInStr($sFilter, ">")) Or (StringInStr($sFilter, "<")) Or (StringInStr($sFilter, "|")) Or (StringStripWS($sFilter, 8) = "") Then Return SetError(2, 2, "")
    If Not ($iFlag = 0 Or $iFlag = 1 Or $iFlag = 2) Then Return SetError(3, 3, "")
    If (StringMid($sPath, StringLen($sPath), 1) = "\") Then $sPath = StringTrimRight($sPath, 1) ; needed for Win98 for x:\ root dir
    $hSearch = FileFindFirstFile($sPath & "\" & $sFilter)
    If $hSearch = -1 Then Return SetError(4, 4, "")
    While 1
    $sFile = FileFindNextFile($hSearch)
    If @error Then
    SetError(0)
    ExitLoop
    EndIf
    If $iFlag = 1 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") <> 0 Then ContinueLoop
    If $iFlag = 2 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") = 0 Then ContinueLoop
    $asFileList &= $sFile & @CR
    WEnd
    FileClose($hSearch)
    If Not $asFileList Then
    Dim $asFileList[1]=[0]
    Return SetError(1,0,$asFileList)
    EndIf
    Return StringSplit(StringTrimRight($asFileList,1),@CR)
    EndFunc ;==>_SHLV__FileListToArray2

    [/autoit]

    Edit hatte eine Indexabfrage zuviel, angepaßt.

  • @FireTiger: Der Code von mir war schon fast korrekt, aber wie BugFix schon geschrieben hat, hatte ich vergessen, $nIndex bei $NM_DBLCLICK zuzuweisen :rolleyes:
    Tausche also bei meinem Skript einfach

    [autoit]

    If $nIndex = -2 Then
    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
    DllStructGetData($tInfo, "Index")
    EndIf

    [/autoit]

    gegen

    [autoit]

    If $nIndex = -2 Then
    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
    $nIndex = DllStructGetData($tInfo, "Index") ; <:|=======<
    EndIf

    [/autoit]
    • Offizieller Beitrag

    @progandy hab ich eine Denkfehler, oder würde folgende _SHLV_WM_NOTIFY nicht genausogut funktionieren?

    Spoiler anzeigen
    [autoit]

    Func _SHLV_WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo, $hListView1 = $SHELLLISTVIEWHANDLE

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

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
    Case $hListView1
    Local $nIndex = -2
    Switch $iCode
    Case $NM_RETURN,$NM_DBLCLK
    $nIndex = _GUICtrlListView_GetSelectedIndices($hListView1,True)
    If IsArray($nIndex) And $nIndex[0]=1 Then
    $nIndex = $nIndex[1]
    EndIf
    Local $ItemText = _GUICtrlListView_GetItemText($hListView1, $nIndex, 0)
    If StringInStr(FileGetAttrib($DIRECTORY_LOCAL&$ItemText),"D") Then
    $DIRECTORY_LOCAL &= $ItemText
    _SHLV_PopulateLocalListView($ListView1,$DIRECTORY_LOCAL)
    ElseIf StringRegExp($ItemText, "\A[A-Za-z]:\\\Z") Then
    $DIRECTORY_LOCAL = $ItemText
    _SHLV_PopulateLocalListView($ListView1,$DIRECTORY_LOCAL)
    ElseIf $ItemText = "< .. >" Then
    Local $slash = StringInStr($DIRECTORY_LOCAL, "\", 1, -2)
    If $slash Then
    $DIRECTORY_LOCAL = StringLeft($DIRECTORY_LOCAL, $slash)
    ElseIf StringRegExp($DIRECTORY_LOCAL, "\A[A-Za-z]:\\\Z") Then
    $DIRECTORY_LOCAL = ""
    EndIf
    _SHLV_PopulateLocalListView($ListView1,$DIRECTORY_LOCAL)
    Else
    If MsgBox(36, "ShellListView", "Soll diese Datei geöffnet werden? " & @CRLF & $DIRECTORY_LOCAL&$ItemText) = 6 Then
    ShellExecute($DIRECTORY_LOCAL&$ItemText,"", $DIRECTORY_LOCAL)
    EndIf
    EndIf
    ; No return value
    EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_NOTIFY

    [/autoit]

    Sorry wegen der fragerei, kenn mich mit DllStructuren immer noch nicht aus. Deshalb umgeh ich des ganze meistens. ;)

  • Es geht schon, aber warum den Index nochmal extra auslesen, wenn man ihn über die Struktur bekommt? Wenn man mehrfache Auswahl aktiviert hat, bekommt man dann nicht zwingend den richtigen Index, aber über die DLLStruct schon ;)

    • Offizieller Beitrag

    @progandy. Ich glaub langsam steig ich da durch. Du hast die Indexabfrage bei $NM_RETURN über _GUICtrlListView_GetSelectedIndices gemacht, weil die Daten bei $tagNMITEMACTIVATE in diesem Fall nicht korrekt sind. Irgendwie kommen dann immer Chaotische Werte.
    Das scheint an dem Bug in der Notify behandlung zu liegen. Danke für deine Geduld. :D

    Edit :Noch eine Frage zu dem Code :

    [autoit]

    Func _ListView_AllowEnter_WindowProc($hWnd, $Msg, $wParam, $lParam)
    If $hWnd=$hListView1 And $Msg=$WM_GETDLGCODE And $wParam=0x0D Then Return 0x4 ;$DLGC_WANTALLKEYS
    Return _WinAPI_CallWindowProc($_HLISTVIEW_wProcOld, $hWnd, $Msg, $wParam, $lParam)
    EndFunc

    [/autoit]

    Soweit ich das jetz verstanden habe wird hierbei abgefrag ob die Taste Return gedückt wurde(x0D). Was bewirkt das Return 0x4? Oder besser, wofür steht 0x4? Den Rest der Funktion hab ich soweit verstanden, das wenn nicht Return gedrückt wurde, die Nachricht an die Ursprüngliche Notify Abfrage weitergeleitet wird .

  • Hier hab ich gefunden, dass die ListView ENTER nicht annimmt und man daher die Funktion überschreiben muss, die das blockiert. Dazu muss die WindowProc bei $WM_GETDLGCODE den Wert DLGC_WANTALLKEYS
    zurückgeben, wenn Enter gedrückt wurde ;)

    Und leider gibt es bei $NM_RETURN keine $tagNMITEMACTIVATE-Struct sondern nur $tagNMHDR. Es wird also kein index mitgeliefert.

    • Offizieller Beitrag

    Danke dir, jetzt hab ich es gefressen :D