Hallo,
ich benötige immer wieder eine Verzeichnis- und Dateiindexizierung, in Form von einer Textdatei (txt) zum Vergleich mit der Vorgängerdatei und einer html Datei wegen des einfachen Verzeichnisbrowsings.
Nun habe ich versucht (so schwer habe ich mir es nicht vorgestellt) meine funktionierende Indexizierung ohne GUI, in ein kleines Programm mit GUI zu ändern.
Hier meine funktionierende Indexerstellung als Code ohne GUI (zum klicken): Zu beachten gilt, dass die Indexerstellung im Script directory durchgeführt wird.
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\ICON\Icon\logo_gruen.ico
#AutoIt3Wrapper_Outfile=Indexx.exe
#AutoIt3Wrapper_Compression=3
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_Comment=Freeware
#AutoIt3Wrapper_Res_Description=Diese Software erstellt eine Index.html und index.txt-Datei im Ausführungsverzeichnis
#AutoIt3Wrapper_Res_Fileversion=1.1.2.167
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=Top-PE.de 2015
#AutoIt3Wrapper_Res_Language=1031
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;~ https://www.virustotal.com/de/file/1f19fdb90488145b5d228e7cba2368860efa816a6ca8e65a17d0f26bbf3462ec/analysis/1438887633/
;;;;;;;;;;;;;;;;;;;;;;;;
;; Indexx: ;;
;; Jürgen Hägele 2015 ;;
;; Top-PE.de ;;
;;;;;;;;;;;;;;;;;;;;;;;;
;AutoIt v3.3.9.21 or higher needed!
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;===================================================================
;Code für die Animation von UEZ
;===================================================================
AutoItSetOption("TrayMenuMode", 11)
_GDIPlus_Startup()
Global Const $STM_SETIMAGE = 0x0172; $IMAGE_BITMAP = 0
Global $iW = 400, $iH = 250
Global Const $hGUI = GUICreate("Loading Spinner", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState()
Global $hHBmp_BG, $hB, $iPerc = 0, $iSleep = 30, $s = 0, $t, $m = 0
GUIRegisterMsg($WM_TIMER, "PlayAnim")
DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0)
;===================================================================
;~ Code für Index.html von Michael Ramb. Abgeändert.
;===================================================================
$search = FileFindFirstFile("*.*")
; Check ob Suche erfolgreich war
If $search = -1 Then
MsgBox(0, "Fehler", "Keine Dateien gefunden")
Exit
EndIf
FileDelete("index.html")
$filew = FileOpen("index.html", 1)
If $filew = -1 Then
MsgBox(0, "Fehler", "Kann Datei nicht öffnen.")
Exit
EndIf
;===================================================================
;~ Kopfzeile und Tabelle der index.html füllen abgeändert
;===================================================================
FileWriteLine($filew, "<style><center><!--body{ font-family: Times; font-size: 16px }--><!--tr{ font-family: Times; font-size: 16px }--></center></style>" & @CRLF)
FileWriteLine($filew, "<center><b>Verzeichnis- und Dateiliste</b><br><br></center>" & @CRLF)
FileWriteLine($filew, "<center><table width=500 border=1></center>" & @CRLF)
FileWriteLine($filew, "<center><tr><td><b>Nr.</b></td><td><b>Verzeichnis- oder Dateiname</b></td><td><b>Dateigrösse (KB)</td></tr></b></center>" & @CRLF)
$i=0
$F=1
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
If $file= "index.html" or $file="egal.html" then
Else
FileWriteLine($filew, "<tr>" & @CRLF)
$size = FileGetSize($file)/1000
FileWriteLine($filew, "<td align=center>"&$F&"</td><td><a href=" & $file & ">" & $file & "</a></td><td>" & $size &" KB<br></td></tr>")
$i=$i +1
$F=$F +1
EndIf
WEnd
;===================================================================
;~ Fußeile der index.html füllen abgeändert
;===================================================================
FileWriteLine($filew, "</table> <p><font size=3 face=Times> • © 2015 Top-PE.de • </p>" & @CRLF)
FileWriteLine($filew, "</table> <p><font size=3 face=Times> • Diese Datei und Verzeichnisliste wurde von <b><a href=http://top-pe.de>Indexx</a></b> erstellt • </p>" & @CRLF)
FileClose($search)
FileClose($filew)
;===================================================================
; Bissle warten.
Sleep(200)
;===================================================================
;Diesen Befehl ausführen, wenn ein Verzeichnis fest steht.
;RunWait(@ComSpec & ' /c ' & 'dir %ProgramFiles% /n /os /4 /s > index.txt' & '"', "", @SW_HIDE)
RunWait(@ComSpec & ' /c ' & 'dir /n /os /4 /s > index_.txt' & '"', "", @WorkingDir, @SW_HIDE)
Sleep(200)
RunWait(@ComSpec & ' /c ' & 'cmd /U /C TYPE index_.txt > index.txt' & '"', "", @WorkingDir, @SW_HIDE)
Sleep(200)
RunWait(@ComSpec & ' /c ' & 'del index_.txt' & '"', "", @WorkingDir, @SW_HIDE)
Sleep(200)
;===================================================================
;Diesen Text je nach GUI abändern.
;===================================================================
GUIRegisterMsg($WM_TIMER, "")
_WinAPI_DeleteObject($hHBmp_BG)
_GDIPlus_Shutdown()
GUIDelete()
Sleep(200)
MsgBox(64+4096,"Indexx-Meldung:" , "Die Erstellung der Dateien Index.html und Index.txt wurde im Ausführungsverzeichnis erfolgreich abgeschlossen")
Exit
;===================================================================
;Weiter mit dem Code für die Start-Animation von UEZ
;===================================================================
Func PlayAnim()
$hHBmp_BG = _GDIPlus_MultiColorLoader($iW, $iH, "Bitte warten Sie, bis die Animation endet und die Dateien Index.html und Index.txt für Sie erstellt wurden. ")
$hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG)
If $hB Then _WinAPI_DeleteObject($hB)
_WinAPI_DeleteObject($hHBmp_BG)
EndFunc ;==>PlayAnim
Func _GDIPlus_MultiColorLoader($iW, $iH, $sText = "Der Index wird für Sie erstellt.", $sFont = "Verdana", $bHBitmap = True)
Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
Local Const $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($hGfx, 4 + (@OSBuild > 5999))
_GDIPlus_GraphicsSetTextRenderingHint($hGfx, 3)
_GDIPlus_GraphicsSetPixelOffsetMode($hGfx, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)
_GDIPlus_GraphicsClear($hGfx, 0xFF232323)
Local $iRadius = ($iW > $iH) ? $iH * 0.6 : $iW * 0.6
Local Const $hPath = _GDIPlus_PathCreate()
_GDIPlus_PathAddEllipse($hPath, ($iW - ($iRadius + 24)) / 2, ($iH - ($iRadius + 24)) / 2, $iRadius + 24, $iRadius + 24)
Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
_GDIPlus_PathBrushSetCenterColor($hBrush, 0xFFFFFFFF)
_GDIPlus_PathBrushSetSurroundColor($hBrush, 0x08101010)
_GDIPlus_PathBrushSetGammaCorrection($hBrush, True)
Local $aBlend[4][2] = [[3]]
$aBlend[1][0] = 0 ;0% center color
$aBlend[1][1] = 0 ;position = boundary
$aBlend[2][0] = 0.33 ;70% center color
$aBlend[2][1] = 0.1 ;10% of distance boundary->center point
$aBlend[3][0] = 1 ;100% center color
$aBlend[3][1] = 1 ;center point
_GDIPlus_PathBrushSetBlend($hBrush, $aBlend)
Local $aRect = _GDIPlus_PathBrushGetRect($hBrush)
_GDIPlus_GraphicsFillRect($hGfx, $aRect[0], $aRect[1], $aRect[2], $aRect[3], $hBrush)
_GDIPlus_PathDispose($hPath)
_GDIPlus_BrushDispose($hBrush)
Local Const $hBrush_Black = _GDIPlus_BrushCreateSolid(0xFF161616)
_GDIPlus_GraphicsFillEllipse($hGfx, ($iW - ($iRadius + 10)) / 2, ($iH - ($iRadius + 10)) / 2, $iRadius + 10, $iRadius + 10, $hBrush_Black)
Local Const $hBitmap_Gradient = _GDIPlus_BitmapCreateFromScan0($iRadius, $iRadius)
Local Const $hGfx_Gradient = _GDIPlus_ImageGetGraphicsContext($hBitmap_Gradient)
_GDIPlus_GraphicsSetSmoothingMode($hGfx_Gradient, 4 + (@OSBuild > 5999))
Local Const $hMatrix = _GDIPlus_MatrixCreate()
Local Static $r = 0
_GDIPlus_MatrixTranslate($hMatrix, $iRadius / 2, $iRadius / 2)
_GDIPlus_MatrixRotate($hMatrix, $r)
_GDIPlus_MatrixTranslate($hMatrix, -$iRadius / 2, -$iRadius / 2)
_GDIPlus_GraphicsSetTransform($hGfx_Gradient, $hMatrix)
$r += 10
Local Const $hBrush_Gradient = _GDIPlus_LineBrushCreate($iRadius, $iRadius / 2, $iRadius, $iRadius, 0xFF000000, 0xFF33CAFD, 1)
_GDIPlus_LineBrushSetGammaCorrection($hBrush_Gradient)
_GDIPlus_GraphicsFillEllipse($hGfx_Gradient, 0, 0, $iRadius, $iRadius, $hBrush_Gradient)
_GDIPlus_GraphicsFillEllipse($hGfx_Gradient, 4, 4, $iRadius - 8, $iRadius - 8, $hBrush_Black)
_GDIPlus_GraphicsDrawImageRect($hGfx, $hBitmap_Gradient, ($iW - $iRadius) / 2, ($iH - $iRadius) / 2, $iRadius, $iRadius)
_GDIPlus_BrushDispose($hBrush_Gradient)
_GDIPlus_BrushDispose($hBrush_Black)
_GDIPlus_GraphicsDispose($hGfx_Gradient)
_GDIPlus_BitmapDispose($hBitmap_Gradient)
_GDIPlus_MatrixDispose($hMatrix)
Local Const $hFormat = _GDIPlus_StringFormatCreate()
Local Const $hFamily = _GDIPlus_FontFamilyCreate($sFont)
Local Const $hFont = _GDIPlus_FontCreate($hFamily, $iRadius / 10)
_GDIPlus_StringFormatSetAlign($hFormat, 1)
_GDIPlus_StringFormatSetLineAlign($hFormat, 1)
Local $tLayout = _GDIPlus_RectFCreate(0, 0, $iW, $iH)
Local Static $iColor = 0x00, $iDir = 13
Local $hBrush_txt = _GDIPlus_BrushCreateSolid(0xFF000000 + 0x010000 * $iColor + 0x0100 * $iColor + $iColor)
_GDIPlus_GraphicsDrawStringEx($hGfx, $sText, $hFont, $tLayout, $hFormat, $hBrush_txt)
$iColor += $iDir
If $iColor > 0xFF Then
$iColor = 0xFF
$iDir *= -1
ElseIf $iColor < 0x16 Then
$iDir *= -1
$iColor = 0x16
EndIf
_GDIPlus_BrushDispose($hBrush_txt)
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_GraphicsDispose($hGfx)
If $bHBitmap Then
Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
_GDIPlus_BitmapDispose($hBitmap)
Return $hHBITMAP
EndIf
Return $hBitmap
EndFunc
Alles anzeigen
So .... und jetzt beginnen die Probleme mit der GUI.
Ich schaffe es nicht, mit meinen bescheidenen Hirnwindungen den richtigen Code in die richtige Reihenfolge zu bekommen oder ich habe ein paar Zeilen vergessen oder falsch geschrieben?
Was geht ist:
1.) Die Gui Startet , leider ....die Index.txt wird unabhängig von dem was oben im Auswahlfeld enthalten ist, immer nur im Script-Directory erstellt wenn der Button dazu angeklickt wird . Es tut also nicht so wie es soll.
Was nicht geht ist:
1.) Ich möchte, dass die Indexdatei von dem im Auswahl-Feld angegebenen Pfad erstellt wird und nicht nur im Script-Dir.
2.) Dass auch in dem angegebenen Pfad die html Datei erstellt werden kann.
3.) Dass die Animation von UEZ bei der Erstellung der Dateien ausgegeben wird.
Hier der Code von der GUI-Version:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\ICON\Icon\logo_gruen.ico
#AutoIt3Wrapper_Outfile=Indexx.exe
#AutoIt3Wrapper_Compression=3
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_Comment=Freeware
#AutoIt3Wrapper_Res_Description=Diese Software erstellt für Sie eine Index.html und index.txt-Datei im Ausführungsverzeichnis
#AutoIt3Wrapper_Res_Fileversion=1.1.2.167
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=Top-PE.de 2015
#AutoIt3Wrapper_Res_Language=1031
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;~ https://www.virustotal.com/de/file/1f19fdb90488145b5d228e7cba2368860efa816a6ca8e65a17d0f26bbf3462ec/analysis/1438887633/
;;;;;;;;;;;;;;;;;;;;;;;;
;; Indexx: ;;
;; Jürgen Hägele 2015 ;;
;; Top-PE.de ;;
;;;;;;;;;;;;;;;;;;;;;;;;
;AutoIt v3.3.9.21 or higher needed!
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#Region ### START Koda GUI section ### Form=d:\!meine software\!indexx\form1.kxf
$Form1_1 = GUICreate("Indexx", 525, 155, 443, 139)
$Input1 = GUICtrlCreateInput("Kein Ordner-Pfad angegeben!", 120, 48, 369, 21)
$button1 = GUICtrlCreateButton("Ordner wählen", 16, 48, 80, 21, $BS_ICON)
;~ GUICtrlSetImage(-1, "shell32.dll", 4)
$Label1 = GUICtrlCreateLabel("Bitte Verzeichnis-Pfad zur Index-Dateierstellung auswählen:", 18, 18, 322, 17)
$Button2 = GUICtrlCreateButton("Index.txt erstellen", 16, 88, 105, 33)
$Button3 = GUICtrlCreateButton("Index.html erstellen", 261, 88, 105, 33)
$Button4 = GUICtrlCreateButton("Index.txt öffnen", 139, 88, 105, 33)
$Button5 = GUICtrlCreateButton("Index.html öffnen", 386, 88, 105, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;===================================================================
;Code für die Animation von UEZ
;===================================================================
AutoItSetOption("TrayMenuMode", 11)
;~ _GDIPlus_Startup()
;~ Global Const $STM_SETIMAGE = 0x0172; $IMAGE_BITMAP = 0
;~ Global $iW = 400, $iH = 250
;~ Global Const $hGUI = GUICreate("Loading Spinner", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
;~ Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH)
;~ GUICtrlSetState(-1, $GUI_DISABLE)
;~ GUISetState()
;~ Global $hHBmp_BG, $hB, $iPerc = 0, $iSleep = 30, $s = 0, $t, $m = 0
;~ GUIRegisterMsg($WM_TIMER, "PlayAnim")
;~ DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
pfad()
Case $button2
;~ StartAnim()
_indextxt()
Sleep(200)
;~ StopAnim()
Case $Button4
;~ StartAnim()
_opentxt()
Sleep(200)
;~ StopAnim()
Case $button3
;~ StartAnim()
_indexhtml()
Sleep(200)
;~ StopAnim()
Case $Button5
;~ StartAnim()
_openhtml()
Sleep(200)
EndSwitch
WEnd
;===================================================================
;~ Code für Index.html von Michael Ramb. Abgeändert.
;===================================================================
$search = FileFindFirstFile("*.*")
$file = FileFindNextFile($search)
$filew = FileOpen("index.html", 1)
Func _indexhtml()
; Check ob Suche erfolgreich war
If $search = -1 Then
MsgBox(0, "Fehler", "Keine Dateien gefunden")
Exit
EndIf
FileDelete("index.html")
If $filew = -1 Then
MsgBox(0, "Fehler", "Kann Datei nicht öffnen.")
Exit
EndIf
;===================================================================
;~ Kopfzeile und Tabelle der index.html füllen
;===================================================================
FileWriteLine($filew, "<style><center><!--body{ font-family: Times; font-size: 16px }--><!--tr{ font-family: Times; font-size: 16px }--></center></style>" & @CRLF)
FileWriteLine($filew, "<center><b>Verzeichnis- und Dateiliste</b><br><br></center>" & @CRLF)
FileWriteLine($filew, "<center><table width=500 border=1></center>" & @CRLF)
FileWriteLine($filew, "<center><tr><td><b>Nr.</b></td><td><b>Verzeichnis- oder Dateiname</b></td><td><b>Dateigrösse (KB)</td></tr></b></center>" & @CRLF)
$i=0
$F=1
While 1
If @error Then ExitLoop
If $file= "index.html" or $file="egal.html" then
Else
FileWriteLine($filew, "<tr>" & @CRLF)
$size = FileGetSize($file)/1000
FileWriteLine($filew, "<td align=center>"&$F&"</td><td><a href=" & $file & ">" & $file & "</a></td><td>" & $size &" KB<br></td></tr>")
$i=$i +1
$F=$F +1
EndIf
WEnd
;===================================================================
;~ Fußeile der index.html füllen
;===================================================================
FileWriteLine($filew, "</table> <p><font size=3 face=Times> • © 2015 Top-PE.de • </p>" & @CRLF)
FileWriteLine($filew, "</table> <p><font size=3 face=Times> • Diese Datei und Verzeichnisliste wurde von <b><a href=http://top-pe.de>Indexx</a></b> erstellt • </p>" & @CRLF)
FileClose($search)
FileClose($filew)
Sleep(200)
;Exit
EndFunc ;==>_indexhtml
;===================================================================
; Warten.
Sleep(200)
;===================================================================
Func _indextxt()
$sPath = GUICtrlRead($Input1)
If $sPath = "Kein Ordner-Pfad angegeben!" Then
$sPath = @ScriptDir
GUICtrlSetData($Input1, $sPath)
Else
MsgBox(270400,"Kein Ordner-Pfad angegeben!",$Input1)
Exit
EndIf
RunWait(@ComSpec & ' /c ' & 'dir /n /os /4 /s > index_.txt' & '"', "", @ScriptDir, @SW_HIDE)
Sleep(200)
RunWait(@ComSpec & ' /c ' & 'cmd /U /C TYPE index_.txt > index.txt' & '"', "", @ScriptDir, @SW_HIDE)
Sleep(200)
RunWait(@ComSpec & ' /c ' & 'del index_.txt' & '"', "", @ScriptDir, @SW_HIDE)
Sleep(200)
;Exit
EndFunc ;==>_index.txt
Func _opentxt()
Run(@ComSpec & " /c start index.txt", @ScriptDir, @SW_HIDE)
Sleep(200)
;Exit
EndFunc ;==>_opentxt
Func _openhtml()
Run(@ComSpec & " /c start index.html", @ScriptDir, @SW_HIDE)
Sleep(200)
;Exit
EndFunc ;==>_opentxt
;===================================================================
;Diesen Text je nach GUI abändern.
;===================================================================
;~ GUIRegisterMsg($WM_TIMER, "")
;~ _WinAPI_DeleteObject($hHBmp_BG)
;~ _GDIPlus_Shutdown()
;~ GUIDelete()
;~ Sleep(200)
MsgBox(64+4096,"Indexx-Meldung:" , "Die Erstellung der Dateien Index.html und Index.txt wurde im Ausführungsverzeichnis erfolgreich abgeschlossen")
;~ Exit
;==================================================================================================
; Function Name: _GetFilesFolder_Rekursiv($sPath [, $sExt='*' [, $iDir=-1 [, $iRetType=0 ,[$sDelim='0']]]])
; Description: Rekursive Auflistung von Dateien und/oder Ordnern
; Parameter(s): $sPath der Basispfad für die Auflistung ('.' -aktueller Pfad, '..' -Parentpfad)
; $sExt Erweiterung für Dateiauswahl '*' oder -1 für alle (Standard)
; $iDir -1 Dateien+Ordner(Standard), 0 nur Dateien, 1 nur Ordner
; optional: $iRetType 0 gibt Array, 1 gibt String zurück
; optional: $sDelim legt Trennzeichen für Stringrückgabe fest
; 0 -@CRLF (Standard) 1 -@CR 2 -@LF 3 -';' 4 -'|'
; Return Value(s): Array (Standard) od. String mit den gefundenen Pfaden der Dateien und/oder Ordner
; Array[0] enthält die Anzahl der gefundenen Dateien/Ordner
; Author(s): BugFix (bugfix@autoit.de)
;==================================================================================================
Func _GetFilesFolder_Rekursiv($sPath, $sExt, $iDir=0, $iRetType=0, $sDelim='0')
Global $oFSO = ObjCreate('Scripting.FileSystemObject')
Global $strFiles = ''
Switch $sDelim
Case '1'
$sDelim = @CR
Case '2'
$sDelim = @LF
Case '3'
$sDelim = ';'
Case '4'
$sDelim = '|'
Case Else
$sDelim = @CRLF
EndSwitch
If ($iRetType < 0) Or ($iRetType > 1) Then $iRetType = 0
If $sExt = -1 Then $sExt = '*'
If ($iDir < -1) Or ($iDir > 1) Then $iDir = -1
_ShowSubFolders($oFSO.GetFolder($sPath),$sExt,$iDir,$sDelim)
If $iRetType = 0 Then
Local $aOut
$aOut = StringSplit(StringTrimRight($strFiles, StringLen($sDelim)), $sDelim, 1)
If $aOut[1] = '' Then
ReDim $aOut[1]
$aOut[0] = 0
EndIf
Return $aOut
Else
Return StringTrimRight($strFiles, StringLen($sDelim))
EndIf
EndFunc
Func _ShowSubFolders($Folder, $Ext='*', $Dir=-1, $Delim=@CRLF)
If Not IsDeclared("strFiles") Then Global $strFiles = ''
If ($Dir = -1) Or ($Dir = 0) Then
For $file In $Folder.Files
If $Ext <> '*' Then
If StringRight($file.Name, StringLen($Ext)) = $Ext Then _
$strFiles &= $file.Path & $Delim
Else
$strFiles &= $file.Path & $Delim
EndIf
Next
EndIf
For $Subfolder In $Folder.SubFolders
If ($Dir = -1) Or ($Dir = 1) Then $strFiles &= $Subfolder.Path & '\' & $Delim
_ShowSubFolders($Subfolder, $Ext, $Dir, $Delim)
Next
EndFunc
;===================================================================
;Weiter mit dem Code für die Start-Animation von UEZ
;===================================================================
;~ Func PlayAnim()
;~ $hHBmp_BG = _GDIPlus_MultiColorLoader($iW, $iH, "Bitte warten Sie, bis die Animation endet und die Dateien Index.html und Index.txt für Sie erstellt wurden. ")
;~ $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG)
;~ If $hB Then _WinAPI_DeleteObject($hB)
;~ _WinAPI_DeleteObject($hHBmp_BG)
;~ EndFunc ;==>PlayAnim
;~ Func _GDIPlus_MultiColorLoader($iW, $iH, $sText = "Der Index wird für Sie erstellt.", $sFont = "Verdana", $bHBitmap = True)
;~ Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
;~ Local Const $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap)
;~ _GDIPlus_GraphicsSetSmoothingMode($hGfx, 4 + (@OSBuild > 5999))
;~ _GDIPlus_GraphicsSetTextRenderingHint($hGfx, 3)
;~ _GDIPlus_GraphicsSetPixelOffsetMode($hGfx, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)
;~ _GDIPlus_GraphicsClear($hGfx, 0xFF232323)
;~ Local $iRadius = ($iW > $iH) ? $iH * 0.6 : $iW * 0.6
;~ Local Const $hPath = _GDIPlus_PathCreate()
;~ _GDIPlus_PathAddEllipse($hPath, ($iW - ($iRadius + 24)) / 2, ($iH - ($iRadius + 24)) / 2, $iRadius + 24, $iRadius + 24)
;~ Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
;~ _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFFFFFFFF)
;~ _GDIPlus_PathBrushSetSurroundColor($hBrush, 0x08101010)
;~ _GDIPlus_PathBrushSetGammaCorrection($hBrush, True)
;~ Local $aBlend[4][2] = [[3]]
;~ $aBlend[1][0] = 0 ;0% center color
;~ $aBlend[1][1] = 0 ;position = boundary
;~ $aBlend[2][0] = 0.33 ;70% center color
;~ $aBlend[2][1] = 0.1 ;10% of distance boundary->center point
;~ $aBlend[3][0] = 1 ;100% center color
;~ $aBlend[3][1] = 1 ;center point
;~ _GDIPlus_PathBrushSetBlend($hBrush, $aBlend)
;~ Local $aRect = _GDIPlus_PathBrushGetRect($hBrush)
;~ _GDIPlus_GraphicsFillRect($hGfx, $aRect[0], $aRect[1], $aRect[2], $aRect[3], $hBrush)
;~ _GDIPlus_PathDispose($hPath)
;~ _GDIPlus_BrushDispose($hBrush)
;~ Local Const $hBrush_Black = _GDIPlus_BrushCreateSolid(0xFF161616)
;~ _GDIPlus_GraphicsFillEllipse($hGfx, ($iW - ($iRadius + 10)) / 2, ($iH - ($iRadius + 10)) / 2, $iRadius + 10, $iRadius + 10, $hBrush_Black)
;~ Local Const $hBitmap_Gradient = _GDIPlus_BitmapCreateFromScan0($iRadius, $iRadius)
;~ Local Const $hGfx_Gradient = _GDIPlus_ImageGetGraphicsContext($hBitmap_Gradient)
;~ _GDIPlus_GraphicsSetSmoothingMode($hGfx_Gradient, 4 + (@OSBuild > 5999))
;~ Local Const $hMatrix = _GDIPlus_MatrixCreate()
;~ Local Static $r = 0
;~ _GDIPlus_MatrixTranslate($hMatrix, $iRadius / 2, $iRadius / 2)
;~ _GDIPlus_MatrixRotate($hMatrix, $r)
;~ _GDIPlus_MatrixTranslate($hMatrix, -$iRadius / 2, -$iRadius / 2)
;~ _GDIPlus_GraphicsSetTransform($hGfx_Gradient, $hMatrix)
;~ $r += 10
;~ Local Const $hBrush_Gradient = _GDIPlus_LineBrushCreate($iRadius, $iRadius / 2, $iRadius, $iRadius, 0xFF000000, 0xFF33CAFD, 1)
;~ _GDIPlus_LineBrushSetGammaCorrection($hBrush_Gradient)
;~ _GDIPlus_GraphicsFillEllipse($hGfx_Gradient, 0, 0, $iRadius, $iRadius, $hBrush_Gradient)
;~ _GDIPlus_GraphicsFillEllipse($hGfx_Gradient, 4, 4, $iRadius - 8, $iRadius - 8, $hBrush_Black)
;~ _GDIPlus_GraphicsDrawImageRect($hGfx, $hBitmap_Gradient, ($iW - $iRadius) / 2, ($iH - $iRadius) / 2, $iRadius, $iRadius)
;~ _GDIPlus_BrushDispose($hBrush_Gradient)
;~ _GDIPlus_BrushDispose($hBrush_Black)
;~ _GDIPlus_GraphicsDispose($hGfx_Gradient)
;~ _GDIPlus_BitmapDispose($hBitmap_Gradient)
;~ _GDIPlus_MatrixDispose($hMatrix)
;~ Local Const $hFormat = _GDIPlus_StringFormatCreate()
;~ Local Const $hFamily = _GDIPlus_FontFamilyCreate($sFont)
;~ Local Const $hFont = _GDIPlus_FontCreate($hFamily, $iRadius / 10)
;~ _GDIPlus_StringFormatSetAlign($hFormat, 1)
;~ _GDIPlus_StringFormatSetLineAlign($hFormat, 1)
;~ Local $tLayout = _GDIPlus_RectFCreate(0, 0, $iW, $iH)
;~ Local Static $iColor = 0x00, $iDir = 13
;~ Local $hBrush_txt = _GDIPlus_BrushCreateSolid(0xFF000000 + 0x010000 * $iColor + 0x0100 * $iColor + $iColor)
;~ _GDIPlus_GraphicsDrawStringEx($hGfx, $sText, $hFont, $tLayout, $hFormat, $hBrush_txt)
;~ $iColor += $iDir
;~ If $iColor > 0xFF Then
;~ $iColor = 0xFF
;~ $iDir *= -1
;~ ElseIf $iColor < 0x16 Then
;~ $iDir *= -1
;~ $iColor = 0x16
;~ EndIf
;~ _GDIPlus_BrushDispose($hBrush_txt)
;~ _GDIPlus_FontDispose($hFont)
;~ _GDIPlus_FontFamilyDispose($hFamily)
;~ _GDIPlus_StringFormatDispose($hFormat)
;~ _GDIPlus_GraphicsDispose($hGfx)
;~ If $bHBitmap Then
;~ Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
;~ _GDIPlus_BitmapDispose($hBitmap)
;~ Return $hHBITMAP
;~ EndIf
;~ Return $hBitmap
;~ EndFunc;~ EndFunc
Func pfad()
GUISETSTATE(@SW_HIDE)
Global $pfad = FileSelectFolder("Kein Ordner-Pfad angegeben!", "::{00000000-1080-F9E5-6311-4162E05A6BEE}", 4)
If FileExists($pfad) Then
GUICtrlSetData($Input1, $pfad)
EndIf
GUISETSTATE(@SW_SHOW)
EndFunc ;==>pfad
Alles anzeigen
Ich würde mich sehr darüber freuen, wenn Ihr mir die falschen oder fehlenden Codeschnipsel korregieren könntet so dass die GUI-Version läuft. Natürlich bin ich auch sehr über Verbesserungen erfreut. Kritik darf sehr gerne geübt werden, nur ihr müsst einfach wissen, dass ich selbst, so vieles nicht richtig blicke. Ich weiß was ich will, kanns aber leider nur bedingt umsetzen.