datei aus liste öffnen

  • hallo leute

    ich hab in meiner gui ne liste und würde jetzt gerne die meine auswahl in der liste öffnen geht das per doppelklick oder irgendwie?

    wenn ja wie kann ich das machen

    Einmal editiert, zuletzt von holzfelix (10. Januar 2013 um 08:51)

  • bis jetzt habe ich nur ein array

    welches in meine liste geschrieben wird und zwar so:


    [autoit]

    For $i = 1 To UBound($bugListe) - 1
    FileWrite($reportfile, "[" & $i & "] " & $bugListe[$i][0] & " Fehler: " & $bugListe[$i][1] & @CRLF)
    Sleep(100)
    GuiCtrlSetData($list, $bugListe[$i][0])
    Next

    [/autoit]


    das klappt soweit auch

    nur kein plan wie ich die noch anklickbar mache

    • Offizieller Beitrag
    Spoiler anzeigen
    [autoit]

    #Region ;************ Includes ************
    #Include <WindowsConstants.au3>
    #Include <File.au3>
    #Include <Debug.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiListView.au3>
    #EndRegion ;************ Includes ************

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

    GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY')

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

    $hGUI = GUICreate("Test", 500, 500)

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

    Global $hListView = GUICtrlCreateListView("Items", 10, 10, 480, 380)
    _GUICtrlListView_SetColumnWidth($hListView, 0, 450)

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

    Global $startfolder = @ScriptDir
    Global $FileList = _FileListToArray($startfolder, '*.xls?', 1)
    For $i = 1 To UBound($FileList) -1
    GUICtrlCreateListViewItem($FileList[$i], $hListView)
    Next

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

    $hButton = GUICtrlCreateButton("Search", 10, 460, 100, 30)
    $input = GUICtrlCreateInput("", 200, 460, 100, 30)

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

    GUISetState()

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

    ; Scroll down to hide top item
    _GUICtrlListView_Scroll($hListView, 0, 500)

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $hButton
    $iIndex = _GUICtrlListView_FindInText($hListView, GUICtrlRead($input))
    _GUICtrlListView_ClickItem($hListView, $iIndex)
    EndSwitch
    WEnd

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

    Func WM_NOTIFY($hWnd, $iMsg, $iWparam, $iLparam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTab
    Local $cpMin, $cpMax, $tMsgFilter, $iTab
    $tNMHDR = DllStructCreate($tagNMHDR, $iLparam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
    $iIDFrom = DllStructGetData($tNMHDR, 'IDFrom')
    $iCode = DllStructGetData($tNMHDR, 'Code')
    Switch $hWndFrom
    ; Listivew
    Case GUICtrlGetHandle($hListView)
    ;~ ConsoleWrite("Listview" & @CRLF)
    Switch $iCode
    Case $NM_DBLCLK
    Local $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'))
    $file = _GUICtrlListView_GetItemText($hListView, DllStructGetData($tInfo, 'Index'), 0)
    ConsoleWrite($file & @LF)
    ShellExecute(@ScriptDir & '\' & $file)
    ;~ $cpPassword = _GUICtrlListView_GetItemText($logins_LV, DllStructGetData($tInfo, 'Index'), 2)
    EndSwitch
    EndSwitch
    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]
    • Offizieller Beitrag

    So, aber guck dir dazu die Hilfe an. Die ist super.

    Spoiler anzeigen
    [autoit]

    #Region ;************ Includes ************
    #Include <WindowsConstants.au3>
    #Include <File.au3>
    #Include <Debug.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiListView.au3>
    #EndRegion ;************ Includes ************

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

    GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY')

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

    $hGUI = GUICreate("Test", 500, 500)

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

    Global $hListView = GUICtrlCreateListView("Dateiname|Größe", 10, 10, 480, 380)
    Global $startfolder = @ScriptDir
    Global $FileList = _FileListToArray($startfolder, '*.xls?', 1)
    For $i = 1 To UBound($FileList) -1
    GUICtrlCreateListViewItem($FileList[$i] & '|' & FileGetSize($FileList[$i]), $hListView)
    Next

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

    $hButton = GUICtrlCreateButton("Search", 10, 460, 100, 30)
    $input = GUICtrlCreateInput("", 200, 460, 100, 30)

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

    GUISetState()

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $hButton
    $iIndex = _GUICtrlListView_FindInText($hListView, GUICtrlRead($input))
    _GUICtrlListView_ClickItem($hListView, $iIndex)
    EndSwitch
    WEnd

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

    Func WM_NOTIFY($hWnd, $iMsg, $iWparam, $iLparam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTab
    Local $cpMin, $cpMax, $tMsgFilter, $iTab
    $tNMHDR = DllStructCreate($tagNMHDR, $iLparam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
    $iIDFrom = DllStructGetData($tNMHDR, 'IDFrom')
    $iCode = DllStructGetData($tNMHDR, 'Code')
    Switch $hWndFrom
    ; Listivew
    Case GUICtrlGetHandle($hListView)
    ;~ ConsoleWrite("Listview" & @CRLF)
    Switch $iCode
    Case $NM_DBLCLK
    Local $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'))
    $file = _GUICtrlListView_GetItemText($hListView, DllStructGetData($tInfo, 'Index'), 0)
    ConsoleWrite($file & @LF)
    ShellExecute(@ScriptDir & '\' & $file)
    ;~ $cpPassword = _GUICtrlListView_GetItemText($logins_LV, DllStructGetData($tInfo, 'Index'), 2)
    EndSwitch
    EndSwitch
    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]
  • das mit dem öffnen hab ich noch nicht geblickt wie das geht :(

    könntest du mir das vielleicht erklären?