Ich spring mal ein, solange iF nicht wieder im Lande ist.
Hab schnell was hingepinselt. Du brauchst nicht mehrere Codes ausführen, sondern nur hier den einen.
Wird halt der einfachkeitshalber in Sekunden angezeigt. Stoppen kannste jeden einzeln.
Könnte sein, daß ich bei dem schnellen Proggen was übersehen habe, aber vielleicht ist es ja auch so in Ordnung.
Code
DEF GETSYSCOLOR(1) !"USER32","GetSysColor"
decimals 0
Declare ende%,font&
Declare time1%,time2%,time3%,time4%
Declare txt1&,txt2&,txt3&,txt4&
Declare tcal1%,tcal2%,tcal3%,tcal4%,high%
declare b1&,b2&,b3&,b4&
declare stopp1%,stopp2%,stopp3%,stopp4%
font&=Create("Font","ARIAL",100,40,1,0,0)
' ***** Hier Deine eigenen Werte eintragen
time1%=60*30 'halbe Stunde
time2%=60*60 ' Stunde
time3%=60*90 ' 1 1/2 Stunden
time4%=60*120 ' zwei Stunden
'*****************************************
PROC ACTION
high%=high%+1
if time1%=high%
if stopp1%=0
exitwindows 6
endif
elseif time2%=high%
if stopp2%=0
exitwindows 6
endif
elseif time3%=high%
if stopp3%=0
exitwindows 6
endif
elseif time4%=high%
if stopp4%=0
exitwindows 6
endif
endif
if stopp1%=0
tcal1%=time1%-high%
settext txt1&,"Timer 1: "+str$(tcal1%)+ " Sek."
else
enablewindow b1&,0
enablewindow txt1&,0
endif
if stopp2%=0
tcal2%=time2%-high%
settext txt2&,"Timer 2: "+str$(tcal2%)+ " Sek."
else
enablewindow b2&,0
enablewindow txt2&,0
endif
if stopp3%=0
tcal3%=time3%-high%
settext txt3&,"Timer 3: "+str$(tcal3%)+ " Sek."
else
enablewindow b3&,0
enablewindow txt3&,0
endif
if stopp4%=0
tcal4%=time4%-high%
settext txt4&,"Timer 4: "+str$(tcal4%)+ " Sek."
else
enablewindow b4&,0
enablewindow txt4&,0
endif
ENDPROC
Window 0,0-%maxx,%maxy 'Gesamte Bildschirmbreite und Höhe
CLS GETSYSCOLOR(15)
Windowtitle "MY X-TREME SHUTDOWNTIMER :)"
txt1&=Create("Text",%hwnd,"Timer 1:",5,10,800,100)
setfont txt1&,font&
txt2&=Create("Text",%hwnd,"Timer 2:",5,115,800,100)
setfont txt2&,font&
txt3&=Create("Text",%hwnd,"Timer 3:",5,230,800,100)
setfont txt3&,font&
txt4&=Create("Text",%hwnd,"Timer 4:",5,345,800,100)
setfont txt4&,font&
b1&=Create("Button",%hwnd,"STOPP",810,10,100,100)
b2&=Create("Button",%hwnd,"STOPP",810,115,100,100)
b3&=Create("Button",%hwnd,"STOPP",810,230,100,100)
b4&=Create("Button",%hwnd,"STOPP",810,345,100,100)
Settimer 1000
Whilenot ende%
Waitinput
if %wmtimer
ACTION 'Hier wird oben die Prozedur jede Sekunde aufgerufen
endif
case getfocus(b1&):stopp1%=1
case getfocus(b2&):stopp2%=1
case getfocus(b3&):stopp3%=1
case getfocus(b4&):stopp4%=1
Endwhile
Deleteobject font&
Killtimer
Alles anzeigen
Grüsse Rolf
P.S: Im normalen Programmiererfall könnte man den Code und die Variablen wesentlich kürzer schreiben, habs aber so geschrieben, daß evtl. die Chance besteht, daß Du es sogar nachvollziehen kannst und wenn noch besser Spass am programmieren mit XProfan findest ![]()