Ich brauche bitte mal Hilfe für eine GUI.
Ich habe ein Programm geschrieben, welches auf ein externes Datensicherungsprogramm zugreift, dort die notwendigen Eingaben macht und den Ablauf kontrolliert.
Jetzt wollte ich das Programm um eine zusätzliche GUI erweitern, die bei betätigen eine Buttons die xx.exe killt und das Programm beendet. (siehe Quellcode). Jedoch funktioniert der Button ncht wirklich während das Programm läuft. Kann mir jemand sagen wo da der Fehler ist?
Danke!!!
Code
#Region ### START Koda GUI section ### Form=ADaSi2
$ADaSi2 = GUICreate("ADaSi v5.0", 509, 345, 192, 124)
$Top1 = GUICtrlCreateLabel("Datensicherung wurde gestartet", 32, 32, 270, 26)
GUICtrlSetFont(-1, 14, 800, 0, "Times New Roman")
$Top2 = GUICtrlCreateLabel("Image Name: " & $UniqueDescription, 32, 80, 335, 23)
GUICtrlSetFont(-1, 12, 800, 0, "Times New Roman")
$Top3 = GUICtrlCreateLabel("HD Größe: " & $Notes & " GB", 32, 120, 335, 23)
GUICtrlSetFont(-1, 12, 800, 0, "Times New Roman")
$Top4 = GUICtrlCreateLabel("Kompression: " & $Compression, 32, 160, 335, 23)
GUICtrlSetFont(-1, 12, 800, 0, "Times New Roman")
$Button1 = GUICtrlCreateButton("Abbruch", 216, 256, 177, 49, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Times New Roman")
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg1 = GUIGetMsg()
Switch $nMsg1
Case $Button1
$PID = ProcessExists ( "xx.exe" )
If $PID Then ProcessClose ( $PID )
FileDelete ( $ImageDestinationFolder & $UniqueDescription & ".**" )
Exit
Case 0
If $Verify = 0 Then
WinSetOnTop ( "Creating Image", "", 1 )
While ControlFocus( "[CLASS:#32770]", "", "&Image Summary..." ) = 0
Sleep ( 1000 )
WEnd
Else
WinWaitActive ( "Drive/Image Verify Results" )
Sleep ( 200 )
EndIf
; xx zwangsbeenden
$PID = ProcessExists ( "xx.exe" )
If $PID Then ProcessClose ( $PID )
; Directory Listing löschen oder mit der Log nach Dokumentation verschieben
If $Compression > 5 Then
FileMove ( $ImageDestinationFolder & $UniqueDescription & $Format & ".txt", $LW & $Az & "\Dokumentation\" & $UniqueDescription & "_Compressed.txt", 9 )
FileMove ( $ImageDestinationFolder & $UniqueDescription & $Format & ".csv", $LW & $Az & "\Dokumentation\" & $UniqueDescription & "_Compressed.csv", 9 )
ShellExecute ( $LW & $Az & "\Dokumentation\" & $UniqueDescription & "_Compressed.txt", "" , "" , "edit" )
Else
FileDelete ( $ImageDestinationFolder & $UniqueDescription & $Format & ".csv" )
FileCopy ( $ImageDestinationFolder & $UniqueDescription & $Format & ".txt", $LW & $Az & "\Dokumentation\" & $UniqueDescription & "_Imaged.txt", 9 )
ShellExecute ( $LW & $Az & "\Dokumentation\" & $UniqueDescription & "_Imaged.txt", "" , "" , "edit" )
EndIf
Exit
EndSwitch
WEnd
Exit
Alles anzeigen