Ich habe mir ein Suchscript umgebaut, wobei leider nach dem Zusammenstellen das Bild von _GUICtrlListView_SetBkImage nicht weiter angezeigt wird, auch hat die Hilfestellung von denen die dieses Problem auch hatte nix geholfen...
Weiterhin wollte ich bei der Suchfunktion, eine Progressbar einbinden welche solange läuft bis das Script fertig ist mit dem suchen, leider nix hinbekommen..
Spoiler anzeigen
#include <ListviewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <_FileFindNet.au3>
#include <GuiListView.au3>
#include <String.au3>
#include <File.au3>
#include <GuiImageList.au3>
#include <ListboxConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <TreeviewConstants.au3>
#include <ListviewConstants.au3>
#include <bild.au3>
#include <WinAPI.au3>
#include <Crypt.au3>
Opt("GUIOnEventMode", 1)
Opt('MustDeclareVars', 1)
Opt('GUICloseOnESC', 1)
Global $exStyles = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)
DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
[/autoit] [autoit][/autoit] [autoit]Global $szDrive, $szDir, $szFName, $szExt, $EV, $evt, $Path, $listview, $exStyles, $bSaveBinary, $sB64String
_Base64String($bSaveBinary = False)
_Base64Decode($sB64String)
Global Const $D_B_C = -3
Local $SYS[13]
GUICreate('Datei - Sucher', 800, 460, -1, -1)
GUISetBkColor(0xB9D1EA)
GUISetOnEvent(-3, '_ExitComand')
$SYS[0] = GUICtrlCreateListView('', 5, 0, 790, 390, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT))
Local $hLV = GUICtrlGetHandle($SYS[0])
_GUICtrlListView_SetTextColor ($hLV, 0x8080FF)
_GUICtrlListView_SetExtendedListViewStyle($hLV, $exStyles)
_GUICtrlListView_AddColumn($hLV, "SuchErgebnisse: [ Laufwerk: \ Pfad \ Datei ] - Doppelklick zum öffnen des Verzeichnisses!", 790)
Local $hFile = @ScriptDir & "\autoit.jpg"
_GUICtrlListView_SetBkImage($hLV, $hFile)
GUISetState()
$SYS[1] = GUICtrlCreateInput('', 5, 420, 240, 20)
$SYS[2] = GUICtrlCreateCheckbox('Nur Freigegebene Netzwerk-Laufwerke', 430, 410, 205, 20)
$SYS[3] = GUICtrlCreateLabel('Gefunden:', 660, 423, 60, 20)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetFont(-1, 9, 900, '', '')
$SYS[4] = GUICtrlCreateLabel('', 730, 423, 50, 20)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetFont(-1, 9, 900, '', '')
GUICtrlCreateButton('Suchen', 260, 417, 70, 25)
GUICtrlSetOnEvent(-1, '_Starter')
GUICtrlCreateButton('Option', 345, 417, 70, 25)
GUICtrlSetOnEvent(-1, 'OPSHOW')
$SYS[11] = GUICtrlCreateLabel('', 5, 443, 250, 20)
$SYS[12] = GUICtrlCreateCheckbox('Nur Pfadausgabe ', 430, 430, 205, 20)
GUISetState()
GUIRegisterMsg(0x004E, 'VOeffnen')
TrayTip("SuchInformation", "Laufwerke werden Automatisch erkannt und durchsucht !", 5, 1)
Sleep(6000)
TrayTip("clears any tray tip", "", 0)
Global $GUI1 = GUICreate('Datei Option', 480, 100, -1, -1, $WS_POPUPWINDOW)
GUISetBkColor(0xB9D1EA)
$SYS[5] = GUICtrlCreateButton('Kopieren', 20, 30, 80, 22)
GUICtrlSetOnEvent(-1, 'Option')
$SYS[6] = GUICtrlCreateButton('Verschieben', 110, 30, 80, 22)
GUICtrlSetOnEvent(-1, 'Option')
$SYS[7] = GUICtrlCreateButton('Löschen', 200, 30, 80, 22)
GUICtrlSetOnEvent(-1, 'Option')
$SYS[8] = GUICtrlCreateButton('Umbenennen', 20, 58, 80, 22)
GUICtrlSetOnEvent(-1, 'Option')
$SYS[9] = GUICtrlCreateInput('', 110, 60, 350, 20)
GUICtrlCreateButton('Exit', 380, 30, 80, 22)
GUICtrlSetOnEvent(-1, '_Exit1')
GUICtrlCreateLabel('Datei Option', 0, 5, 1000, 20, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetFont(-1, 11, 900, '', '')
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlCreateButton('Aktualisieren', 290, 30, 80, 22)
GUICtrlSetOnEvent(-1, 'OPSHOW')
GUISetState(@SW_HIDE, $GUI1)
Func _Starter()
Dim $Suche = GUICtrlRead($SYS[1]), $Drive, $st = '.', $a, $y, $z = 0, $j_N = 0, $co
If $Suche = '' Then Return GUICtrlCreateListViewItem(' " Error " Keine Eingabe im Suchfeld', $SYS[0])
If $Suche = '*.*' Or $Suche = '*.' Or $Suche = '.*' Then Return MsgBox(0, 'Info', 'Diese [*.*] Wildcard oder nur [*.] u. [.*] wird nicht unterstützt! ',3)
_GUICtrlListView_DeleteAllItems($hLV)
GUICtrlSetData($SYS[4], '')
Dim $obWMI = ObjGet('winmgmts:\\' & $st & '\root\CIMV2')
If BitAND(GUICtrlRead($SYS[12]), $GUI_CHECKED) = $GUI_CHECKED Then $j_N = 1
If BitAND(GUICtrlRead($SYS[2]), $GUI_CHECKED) = $GUI_CHECKED Then
$co = $obWMI.ExecQuery('SELECT * FROM Win32_SystemNetworkConnections')
If Not IsObj($co) Then Return MsgBox(0, 'WMI Output', 'No WMI Objects Found for class: ' & 'Drive ',3)
SplashTextOn('Suche gestartet', ' Bitte warten ...', 150, 40, -1, -1, 20, '', 13)
For $ob In $co
$y = StringSplit($ob.PartComponent, '\')
GUICtrlSetData($SYS[11], 'Suche in : ' & StringReplace('\\' & $y[9] & '\' & $y[11], '"', ''))
$a = _FileFindNet($Suche, StringReplace('\\' & $y[9] & '\' & $y[11], '"', ''), '', $j_N, 0)
For $n = 1 To UBound($a) - 1
GUICtrlCreateListViewItem($a[$n], $SYS[0])
Next
GUICtrlSetData($SYS[4], $a[0])
Next
Else
$co = DriveGetDrive('all')
SplashTextOn('Suche gestartet', ' Bitte warten ...', 150, 40, -1, -1, 20, "", 13)
For $i = 1 To UBound($co) - 1
$Drive = DriveGetFileSystem($co)
If @error = 1 Then ContinueLoop
GUICtrlSetData($SYS[11], 'Suche in : ' & _StringProper($co[$i] & '\') & ' ' & $Drive)
$a = _FileFindNet($Suche, '', _StringProper($co[$i] & '\'), $j_N, 0)
If @error Then ContinueLoop
$z += $a[0]
For $n = 1 To UBound($a) - 1
GUICtrlCreateListViewItem($a[$n], $SYS[0])
Next
GUICtrlSetData($SYS[4], $z)
Next
EndIf
_GUICtrlListView_SetColumnWidth($SYS[0], 0, $LVSCW_AUTOSIZE)
SplashOff()
EndFunc ;==>_Starter
Func OPSHOW()
If GUICtrlRead($SYS[0]) = ' ' Then Return MsgBox(0, 'Info', 'Bitte wählen sie eine Datei im Hauptprogramm [ Tabelle ] aus ! ',3)
$Path = _PathSplit(StringReplace(GUICtrlRead(GUICtrlRead($SYS[0])), '|', ' '), $szDrive, $szDir, $szFName, $szExt)
GUICtrlSetData($SYS[9], $Path[3] & $Path[4])
GUISetState(@SW_SHOW, $GUI1)
EndFunc ;==>OPSHOW
Func Option()
Dim $Folder, $len
$Path = _PathSplit(StringReplace(GUICtrlRead(GUICtrlRead($SYS[0])), '|', ' '), $szDrive, $szDir, $szFName, $szExt)
Switch @GUI_CtrlId
Case $SYS[5]
$Folder = FileSelectFolder('Ordner auswählen', '')
FileCopy($Path[1] & $Path[2] & GUICtrlRead($SYS[9]), $Folder & '\')
ShellExecute($Folder)
Case $SYS[6]
$Folder = FileSelectFolder('Ordner auswählen', '')
FileMove($Path[1] & $Path[2] & GUICtrlRead($SYS[9]), $Folder & '\')
ShellExecute($Folder)
Case $SYS[7]
FileDelete($Path[1] & $Path[2] & GUICtrlRead($SYS[9]))
Case $SYS[8]
If StringLeft(GUICtrlRead($SYS[11]), 2) = '\\' Then Return MsgBox(0, 'Info', ' Datei kann auf diesen Wege nicht Umbenannt werden! ', 3)
$len = StringLen($Path[1] & $Path[2])
Run(@ComSpec & ' /c ' & $Path[1] & ' & cd ' & StringLeft($Path[1] & $Path[2], $len - 1) & ' & REN ' & $Path[3] & $Path[4] & '' & GUICtrlRead($SYS[9]), '', @SW_HIDE, 2)
ShellExecute($Path[1] & $Path[2])
EndSwitch
EndFunc ;==>Option
Func VOeffnen($hWndGUI, $MsgID, $wP, $lP)
If GUICtrlRead(GUICtrlRead($SYS[0])) = '' Then Return (0)
$EV = DllStructCreate('int;int;int', $lP)
If @error Then Return
$evt = DllStructGetData($EV, 3)
If $wP = $SYS[0] Then
If $evt = $D_B_C Then
$Path = _PathSplit(StringReplace(GUICtrlRead(GUICtrlRead($SYS[0])), '|', ''), $szDrive, $szDir, $szFName, $szExt)
ShellExecute($Path[1] & $Path[2])
EndIf
EndIf
EndFunc ;==>VOeffnen
Func _ExitComand()
Exit
EndFunc ;==>_ExitComand
Func _Exit1()
GUISetState(@SW_HIDE, $GUI1)
EndFunc ;==>_Exit1
While 1 * Sleep(10)
WEnd