Hallo Liebe leute!
Habe ein func erstellt die abfragt ob eine datei existiert wenn ja frage ob überschrieben werden soll wenn keine vorhanden dan erstell mit ladebalken für die zeit der berichterstellung.
Ich habe das auch ihn bekommen nach langerzeit aber trotz alle dem ist die func so zerrissen.!
Meine Frage ist es möglich das alles in einer func zu schreiben und kann man das vieleicht anders lösen alles in einer if oder doch ganz anders ??????? ![]()
Hir der code
[autoit]#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <ListViewConstants.au3>
#include <String.au3>
#include <GuiButton.au3>
#include <Inet.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>
#include <File.au3>
Opt('GUIOnEventMode', 1)
Global $GUI1,$GUI2
$GUI1 = GUICreate('', 700, 500, Default, Default)
GUISetOnEvent(-3, '_Exit')
GUICtrlCreateGroup('Schnell - Start', 5, 5, 120, 140)
GUICtrlCreateButton('test', 15, 20, 100, 19)
GUICtrlSetOnEvent(-1, 'ipconfigBreicht')
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState()
;---------------------_____________________________________________________________Ladebalken
Global $Ladebal = GUICreate('', 200, 25, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)
$Progress1 = GUICtrlCreateProgress(0, 0, 200, 25, $PBS_MARQUEE)
$hProgress = GUICtrlGetHandle($Progress1)
_SendMessage($hProgress, $PBM_SETMARQUEE, True,0)
GUISetState(@SW_HIDE,$Ladebal)
;------------------------------------------------------------------------------------------------------------
While 1
Sleep(10000)
WEnd
;------------------------------------------------------------------EXIT___________________________________________________________________________________________
;Hauptmenü
Func _Exit()
Exit
EndFunc
;################################################################## Ab diesem bereich ###########################################################################
;--------------------------------------------------------------------------------------------------------------------eine speicher speicher abfrage
func ipconfigBreicht()
Local $spei
$bLoop = 1
If FileExists('Task.txt') Then
$spei = MsgBox(4,'INFO','Datei Exestiert bereits!'&@CRLF&'Möchten sie die Datei überschreiben?')
Else
GUISetState(@SW_SHOW,$Ladebal)
$ipconB = RunWait(@ComSpec & ' /c ' & 'tasklist /V>Task.txt','',@SW_HIDE,balken())
GUISetState(@SW_HIDE,$Ladebal)
MsgBox(0,"Speicher Bericht","Wurde erfolgreich erstellt!")
$bLoop = 0
EndIf
If $spei = 7 Then
$bLoop = 0
EndIf
While $bLoop = 1
speicher2()
$bLoop = 0
WEnd
EndFunc
Func speicher2()
GUISetState(@SW_SHOW,$Ladebal)
$ipconB = RunWait(@ComSpec & ' /c ' & 'tasklist /V>Task.txt','',@SW_HIDE,balken())
GUISetState(@SW_HIDE,$Ladebal)
MsgBox(0,"Speicher Bericht","Wurde erfolgreich erstellt!")
EndFunc
;--------------------------------------------------------------------------------------------------------------------eine speicher speicher abfrage
Func balken()
Dim $Ladebal, $i, $ipconB
ProcessExists($ipconB)
$i += 1
If $i = 101 then $i = 0
GUICtrlSetData($Progress1,$i)
EndFunc
;############################################################### bis ihr ##########################################################################################
Das ist eine test func!