Hallo Community
Ich steh vor einem Rätsel.
In manchen GUIs lassen sich die Controls verstecken, warum nicht in diesem:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <Process.au3>
#include <File.au3>
$exe = "CMD.EXE"
$indir = "C:\TEMP"
$outfile = "C:\TEST.ISO"
$fsinmb = "5000"
$savdrv = "C:"
$fspace = 10000
$isofertig = 4900
Example()
Local $outfile, $isofertig, $isoaktuell, $command, $exe, $delete, $indir, $fsinmb, $space, $savdrv, $fspace, $PID ;
Sleep(5000)
Func Example()
Local $progressbar1, $button, $wait, $s, $msg, $m, $percent, $outsizeupd, $fs, $wtwf, $PID, $elc, $aved, $aved2, $GUI_HIDE
$PID = ProcessExists($exe)
;----------------------------------------
$delete = FileExists($outfile)
If $delete = 1 Then ; file exists
$fs = "YES"
$elc = "0x66FF33"
Else
$fs = "NO"
$elc = "0xFF0000"
EndIf
;----------------------------------------
GUICreate("MKISOFS - PreMastering - 90330", 660, 260, 50, 500) ; erstellt GUI-Fenster so groß wie DOS-Box
$button = GUICtrlCreateButton("START", 20, 210, 80, 30) ; erstellt START-Button ; ID = 3
GUICtrlSetState (-1, $GUI_HIDE)
GUICtrlSetState (3, $GUI_HIDE)
GuiCtrlSetBkColor(-1, 0xFFFF00) ; gelb
GUICtrlCreateLabel("Input: ", 20, 15) ; ID = 4
GUICtrlSetState (-1, $GUI_HIDE)
GUICtrlCreateInput($indir, 60, 13, 350, 15) ; ID = 5
GUICtrlSetState (-1, $GUI_HIDE)
GUICtrlCreateLabel("Output: ", 20, 45) ; ID = 6
GUICtrlSetState (-1, $GUI_HIDE)
GUICtrlCreateInput($outfile, 60, 43, 350, 15) ; ID = 7
GUICtrlCreateLabel("File exists: ", 560, 45) ; ID = 8
GUICtrlCreateInput($fs, 615, 43, 30, 15) ; ID = 9
GuiCtrlSetBkColor(9, $elc)
$progressbar1 = GUICtrlCreateProgress(10, 80, 640, 20) ; ID = 10 ; Fortschrittsbalken
GUISetState(@SW_SHOW) ; startet die GUI
$m = GUIGetMsg()
If $msg = $button Then GUICtrlSetState (-1, $GUI_HIDE)
EndFunc ;==>Example
Kann ich diese Abfrage als Funktion formulieren:
$delete = FileExists($outfile)
If $delete = 1 Then ; file exists
$fs = "YES"
$elc = "0x66FF33"
Else
$fs = "NO"
$elc = "0xFF0000"
EndIf
Bin dankbar für jeden Hinweis.
Gruß M.