Die Idee finde ich sehr gut also ich würde helfen hab aber zurzeit wenig zeit (6 Schulaufgaben in 3Wochen )
Suche Helfer für ein "AutoIt Kinderpaket" - Jeder ist herzlichst eingeladen!
-
- [ offen ]
-
simon -
15. Juni 2009 um 18:20 -
Geschlossen -
Erledigt
-
-
Ja nuuuu...
Ich selber habe 2 kleine Kinder, mein Großer kommt jetzt bald zur Schule. Da die ollen Retro-Games Ihm Spaß bringen; er aber die ganzen Emulatoren nicht bedienen kann habe ich angefangen den 'Consolero C=500' zu Programieren. Das ist ne Oberfläche in der alle vorhandenen Spiele aller Emulatoren in einer Liste angezeigt werden, und per knopfdruck startet das gewünschte Spiel mit der gewählten Konfiguration. Und das alles ist mit nem Joypad zu bedienen.
Ganz einfache Sache; eigentlichP.S.
Der Consolero kam nie über das Alpha-Stadium herraus. Hatte die Beta schon fertig, aber durch nen Hd-Crash wieder verloren. -
Ja nuuuu...
Ich selber habe 2 kleine Kinder, mein Großer kommt jetzt bald zur Schule. Da die ollen Retro-Games Ihm Spaß bringen; er aber die ganzen Emulatoren nicht bedienen kann habe ich angefangen den 'Consolero C=500' zu Programieren. Das ist ne Oberfläche in der alle vorhandenen Spiele aller Emulatoren in einer Liste angezeigt werden, und per knopfdruck startet das gewünschte Spiel mit der gewählten Konfiguration. Und das alles ist mit nem Joypad zu bedienen.
Ganz einfache Sache; eigentlichP.S.
Der Consolero kam nie über das Alpha-Stadium herraus. Hatte die Beta schon fertig, aber durch nen Hd-Crash wieder verloren.
Ja das ist nicht so toll.
Aber auch wieder ein Programm, was man in so ein Packet aufnehmen könnte -
Ich würde gerne helfen.
Am liebsten wäre ich bei den GUIs tätig, da ich schon etwas Erfahrung damit habe.Und noch zu dem Rechenprogramm: Könntest du mir das Sript per PM bitte schicken? Mich würde mal interessieren wie du die Mathe aufgaben generierst.
-
Besitze das Skript zwar nicht mehr.
Aber ich werde es neu schreiben.
Ist wirklich nicht schwer -
Da fällt mir ein, dass ich auch schon ein kleines (nicht unbedingt optisch schönes) Programm geschrieben habe, das automatisch im Random Fragen stellt. Dann kann man in einer Editbox seine Antwort hineinschreiben, auf einen Button mit der Aufschrift "fertig" klicken und man sieht die korrekte Lösung und seine eigene geschriebene Antwort daneben.
Das einzige, was man bisher noch nicht machen kann, ist Absätze in die Fragen oder Antworten machen.Die Fragen und Antworten werden jeweils aus einer Ini gelesen und angezeigt.
Das tolle ist, dass man so viele Fragen und Antworten in die Ini schreiben kann, wie man will. Es eignet sich daher besonders gut für Aufgaben zum AuswendiglernenIch wollte das Programm eh noch bisschen verbessern, aber derzeit fehlt mir auch die Zeit. Wäre das auch etwas, was dich interessieren würde?
-
Ich wäre auch dabei.
Ich wäre bereit Design's (Kindergerecht) zu machen -
- Offizieller Beitrag
Ich finde die Idee gut.
Wäre bereit ein Programm zu schreiben. Mir fehlt schlichtweg die Idee. Hast Du einen Vorschlag? -
würde mich auch für einen kleinen Teil des Projekts anmelden Gute Idee Betonung liegt auf "kleine" , da ich selbst noch viele Projekte habe
Also sag mir einfach was ich machn soll -
Wäre ebenfalls dabei.
Mir gehts nur leider ähnlich wie Oscar, ich hab i.wie kein plan was ich scripten könnteSowiso fällt mir in letzter Zeit einfach nix gutes mehr ein
-
Ja, und gerade im Bereich Kinder wird einfach zu wenig getan; und wenn dann kostet es unmengen von Kohle... Das müsste man echt ändern. So ein kleiner Mathe-Kurs währe schon eigentlich ein guter Anfang.
-
Dieses Kinderpaket könnte ein schönes Projekt werden
Lest den ersten Post, für die, die bereits geantwortet haben, dass sie mitmachen möchten.
Natürlich ist jeder eingeladen.Aufgrund meiner großen Familie (4 Kinder + Ich) werde ich mir mal angucken was die kleinen hier unter uns gebrauchen könnten.
Wobei Schule ein wenig im Mittelpunkt steht, eben etwas zum lernen.
Die Kindersoftware kostet meist höllisch viel Geld, dann könnte man jedoch etwas ähnliches in AutoIt kreiren =) -
Ich finde die Idee auch großartig und bin jederzeit zur Hilfe bereit.
-
Dies ist das, was ich bis dato habe. Funktioniert, wie gesagt, nur für normale Benutzer. Falls ein Admin die Exe aufruft, können entsprechende Parameter für die User gesetzt werden. Wichtig: User muss schon vorhanden sein!
Spoiler anzeigen
[autoit]#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
[/autoit] [autoit][/autoit] [autoit]
#AutoIt3Wrapper_outfile=timerlog_test.exe
#AutoIt3Wrapper_Res_Comment=Setze Maximale Zeit, die ein Benutzer angemeldet sein darf
#AutoIt3Wrapper_Res_Fileversion=1.0.0.11
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Date.au3>
#include <GuiButton.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#Include <GuiComboBox.au3>
#include <file.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
;Variablendeklaration
Global $date, $datereg, $maxtime, $zaehler, $hgui, $hinput_MoSo,$btn, $btn1, $btn2, $btn3, $label, $hcombo, $label1, $arecords [1] [3], $profilepath, $stretch
Global $Combo_z1, $Combo_z2, $Combo_z3, $Combo_z4, $Combo_z5, $Combo_z6, $Combo_z7, $Combo_z8, $Combo_z9, $Combo_z10, $Combo_z11, $Combo_z12, $Combo_z13
Global $Combo_z14, $Combo_z15, $Combo_z16, $curselcheck, $username, $combochange, $combochange1, $Form1, $Radio1, $Radio2, $Group1, $Save, $Abbruch, $nMsg
Global $hourrecords [97], $logintime, $hinput_Mo, $hinput_Di, $hinput_Mi, $hinput_Do, $hinput_Fr, $hinput_Sa, $hinput_So, $timenow,$logintime1, $logintime2
Global $blogoff, $btnid
;Optionen
Opt("TrayIconHide", 1)
Opt("GUIOnEventMode", 1)
Opt('MustDeclareVars', 1)
; Ergänzung für MS Tool Steady State
; Für lokale User können maximale Rechnerzeit pro Tag eingetragen werden
; Steuerung für Beschränkung über HKLM\Software\MaxTime\<Username>\Restricted Anmeldezeit1;Anmeldezeit2;MaxTime
; Steurung für Überprüfung MaxTime über HKCU\Software\MaxTime Datum und Zaehler
; WMI Abfrage scheidet aus, wegen Domäne
;Administration mit Parameter init
;##### Main ###########################
If IsAdmin () Then
_initadmin ()
_groupusers ()
_gui_settings ()
Else
_init ()
If $blogoff = True Then _checklogintime ()
EndIf
;##### Main ###########################
;##### Funktionen #####################
; Optionale Parameter Komponente für Initialisierung; wird z.Zt nicht genutzt.
Func _check_cmd_admin ()
If IsAdmin () Then
If $CmdLine[0] > 0 Then
If $CmdLine [1] = "init" Then
_initadmin ()
Else
MsgBox (0,"Falscher Aufruf für Administration","Administrativer Aufruf mit Parameter init !", 5)
Exit
EndIf
Else
MsgBox (0,"Falscher Aufruf für Administration","Administrativer Aufruf mit Parameter init !", 5)
Exit
EndIf
EndIf
EndFunc
; Aufruf wenn User Admin
; Auslesen der Schriftarten Grösse
; Lies bis zu 100 Schlüssel unterhalb von HKLM\Software\Maxtime aus und lies in Array
; Lies über DOS Command Mitglieder von Benutzer aus
; Befülle 2D - Array mit Usernamen und MaxLogonTime
Func _initadmin ()
Local $btnid, $f, $i, $var
_stretch ()
$profilepath = StringReplace(@StartupDir, @UserName, "Default User")
If Not FileExists (@ProgramFilesDir & "\Maxtime\timerlog_.exe") Then
$btnid = MsgBox (0, "Timerlog Initialisierung....", "Programmverzeichnis wird erzeugt und Datei kopiert!")
_initapp ()
EndIf
If Not FileExists ($profilepath & "\timerlog.lnk") Then
$btnid = MsgBox (1, "Timerlog Initialisierung....", "Verlinke Timerlog Autostart für Default User?")
If $btnid <> 2 Then FileCreateShortcut(@ProgramFilesDir & "\" & @ScriptName, $profilepath & "\timerlog.lnk")
EndIf
$f = 0
For $i= 1 to 100
$var = RegEnumKey("HKLM\Software\Maxtime", $i)
If @error <> 0 then ExitLoop
$f = $f + 1
Next
RunWait (@ComSpec & " /c " & "net localgroup Benutzer > """ & @TempDir & "\benutzer.txt""")
RunWait (@ComSpec & " /c " & "net localgroup Hauptbenutzer >> """ & @TempDir & "\benutzer.txt""")
$f = $f + _FileCountLines (@TempDir & "\benutzer.txt") - 8
ReDim $arecords [$f] [3]
For $i= 1 to 100
$var = RegEnumKey("HKLM\Software\Maxtime", $i)
If @error <> 0 then ExitLoop
$arecords [$i] [1] = $var
If Not RegRead ("HKLM\Software\MaxTime\" & $arecords [$i] [1], "MaxLogonTime") = 1 Then
$arecords [$i] [2] = "0"
Else
$arecords [$i] [2] = RegRead ("HKLM\Software\MaxTime\" & $arecords [$i] [1], "MaxLogonTime")
EndIf
Next
_fillarray ()
EndFunc
Func _initapp ()
FileCopy (@ScriptFullPath, @ProgramFilesDir & "\Maxtime\timerlog_.exe",8)
FileCreateShortcut(@ProgramFilesDir & "\Maxtime\timerlog_.exe", @DesktopDir & "\timerlog_.lnk")
EndFunc
; Aufruf wenn User ist Benutzer, Initialisierung der erforderlichen Parameter
; Lies lokales Datum aus
; Lies Anmelderestriktionen aus Registry HKLM\Software\MaxTime\<Username>\Restricted Anmeldezeit1;Anmeldezeit2;MaxTime
; Falls Anmeldezeit1 <> Anmeldezeit2 überprüfe ob Anmeldung innerhalb erlaubter Zeit; wenn nicht Abmeldung
; Wenn Datum in HKCU\Software\Maxtime Datum ungleich heutiges Datum -> Setze Datum in Regkey, Setze Zähler auf 1
; -> Ansonsten lies HKCU\Software\Maxtime Zähler aus
; Wenn Zähler = MaxTime dann Abmeldung
Func _init ()
$blogoff = True
$date = _NowDate ()
$timenow = StringSplit (_NowTime (4), ":")
$zaehler = 1
If RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", "AllDay") <> "" Then
$logintime = StringSplit (RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", "AllDay"), ";")
$maxtime = Number ($logintime [3])
If $logintime [1] = "keine" Then
MsgBox (0,"Anmeldung nicht erlaubt....","Anmeldung z. Zt. nicht erlaubt!",10)
_logoff ()
EndIf
If $logintime [1] <> $logintime [2] Then
$logintime1 = StringSplit ($logintime [1], ":")
$logintime2 = StringSplit ($logintime [2], ":")
If Number ($timenow [1]) < Number ($logintime1 [1]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
Else
If Number ($timenow [1]) = Number ($logintime1 [1]) Then
If Number ($timenow [2]) < Number ($logintime1 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
Else
If Number ($timenow [2]) > Number ($logintime1 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
Else
If Number ($timenow [1]) = Number ($logintime2 [1]) Then
If Number ($timenow [2]) >= Number ($logintime2 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
EndIf
EndIf
EndIf
EndIf
Else
If $maxtime = 0 Then Exit
EndIf
Else
If RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", @WDAY) <> "" Then
$logintime = StringSplit (RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", @WDAY), ";")
$maxtime = Number ($logintime [3])
If $logintime [1] = "keine" Then
MsgBox (0,"Anmeldung nicht erlaubt....","Anmeldung z. Zt. nicht erlaubt!",10)
_logoff ()
EndIf
If $logintime [1] <> $logintime [2] Then
$logintime1 = StringSplit ($logintime [1], ":")
$logintime2 = StringSplit ($logintime [2], ":")
If Number ($timenow [1]) < Number ($logintime1 [1]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
Else
If Number ($timenow [1]) = Number ($logintime1 [1]) Then
If Number ($timenow [2]) < Number ($logintime1 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
Else
If Number ($timenow [2]) < Number ($logintime1 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
Else
If Number ($timenow [1]) = Number ($logintime2 [1]) Then
If Number ($timenow [2]) >= Number ($logintime2 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
EndIf
EndIf
EndIf
EndIf
Else
If $maxtime = 0 Then Exit
EndIf
EndIf
EndIf
If RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", "AllDay") = "" Then
If RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", @WDAY) = "" Then Exit
EndIf
If RegRead ("HKEY_CURRENT_USER\Software\MaxTime", "Datum") = "" Then
RegWrite ("HKCU\Software\MaxTime", "Datum", "REG_SZ", $date)
Else
$datereg = RegRead ("HKEY_CURRENT_USER\Software\MaxTime", "Datum")
EndIf
If $datereg <> $date Then
RegWrite ("HKEY_CURRENT_USER\Software\MaxTime", "Zaehler", "REG_SZ", "1")
RegWrite ("HKCU\Software\MaxTime", "Datum", "REG_SZ", $date)
Else
If RegRead ("HKEY_CURRENT_USER\Software\MaxTime", "Zaehler") <> 1 Then
$zaehler = Number (RegRead ("HKEY_CURRENT_USER\Software\MaxTime", "Zaehler"))
EndIf
EndIf
If $maxtime > 0 Then
If $zaehler >= $maxtime Then
MsgBox (0,"Zulässige Anmeldezeit überschritten...", "Zulässige Anmeldezeit von " & $maxtime & " Minuten überschritten!", 10)
_logoff ()
EndIf
EndIf
EndFunc
; Überprüfung, ob Anmeldezeit überschritten
; Wenn Zähler = MaxTime Abmeldung
Func _checklogintime ()
If $maxtime > 0 Then
For $i = $zaehler to $maxtime
RegWrite ("HKEY_CURRENT_USER\Software\MaxTime", "Zaehler", "REG_SZ", $i)
If $logintime [1] <> $logintime [2] Then
$timenow = StringSplit (_NowTime (4), ":")
If $logintime2 [1] = $timenow [1] And $logintime2 [2] = $timenow [2] Then
MsgBox (0,"Anmeldezeit abgelaufen....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
ExitLoop
EndIf
EndIf
If $i = $maxtime Then ExitLoop
Sleep (60000)
Next
_logoff ()
Else
If $logintime [1] <> $logintime [2] Then
$timenow = StringSplit (_NowTime (4), ":")
If $logintime2 [1] = $timenow [1] And $logintime2 [2] = $timenow [2] Then
MsgBox (0,"Anmeldezeit abgelaufen....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
EndIf
EndIf
EndFunc
;Abmeldung
Func _logoff ()
$blogoff = False
MsgBox (0,"Autom. LogOff....", "Abmeldung erfolgt in max. 10 Sek.....", 10)
Shutdown (0)
EndFunc
; Erzeuge Gui
; Räum Array auf
; Sortiere Array
; Befülle ComboBox
; Setze Events für Buttons
; While Schleife: Wenn User für MaxTime eingetragen ist, aktiviere Löschen Button -> Ansonsten Lösche Button deaktiviert
; Befülle Input Feld mit entsprechedem MaxTime Eintrag aus Array
Func _gui_settings ()
Local $username1, $anmeldezeit, $checkradio
$hgui = GUICreate("Einstellungen Maximale Anmeldezeit", 350 * $stretch, 550 * $stretch, -1, -1, $WS_Border, $WS_EX_CLIENTEDGE )
$hcombo = GUICtrlCreateCombo ("", 130 * $stretch, 20 * $stretch, 120 * $stretch,40 * $stretch)
$label = GUICtrlCreateLabel ("User :", 30 * $stretch, 20 * $stretch, 80 * $stretch)
;$label1 = GUICtrlCreateLabel ("MaxLogonTime :", 30 * $stretch, 40 * $stretch, 80 * $stretch)
$Radio1 = GUICtrlCreateRadio("An allen Tagen gleich", 50 * $stretch, 95 * $stretch, 145 * $stretch, 20 * $stretch)
GUICtrlSetState($Radio1, $GUI_CHECKED)
$Radio2 = GUICtrlCreateRadio("unterschiedlich", 50 * $stretch, 125 * $stretch, 145 * $stretch, 20 * $stretch)
$Group1 = GUICtrlCreateGroup("Anmeldezeiten", 30 * $stretch, 75 * $stretch, 280 * $stretch, 390 * $stretch)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Local $Label3 = GUICtrlCreateLabel("Mo - So", 50 * $stretch, 170 * $stretch, 50 * $stretch, 17 * $stretch)
$Combo_z1 = GUICtrlCreateCombo("", 100 * $stretch, 170 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z2 = GUICtrlCreateCombo("", 160 * $stretch, 170 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_MoSo = GUICtrlCreateInput ("", 220 * $stretch, 170 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label4 = GUICtrlCreateLabel("Mo", 70 * $stretch, 200 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z5 = GUICtrlCreateCombo("", 100 * $stretch, 200 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z6 = GUICtrlCreateCombo("", 160 * $stretch, 200 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Mo = GUICtrlCreateInput ("", 220 * $stretch, 200 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label2 = GUICtrlCreateLabel("Di", 70 * $stretch, 230 * $stretch, 14 * $stretch, 17 * $stretch)
$Combo_z3 = GUICtrlCreateCombo("", 100 * $stretch, 230 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z4 = GUICtrlCreateCombo("", 160 * $stretch, 230 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Di = GUICtrlCreateInput ("", 220 * $stretch, 230 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label5 = GUICtrlCreateLabel("Mi", 70 * $stretch, 260 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z7 = GUICtrlCreateCombo("", 100 * $stretch, 260 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z8 = GUICtrlCreateCombo("", 160 * $stretch, 260 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Mi = GUICtrlCreateInput ("", 220 * $stretch, 260 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label6 = GUICtrlCreateLabel("Do", 70 * $stretch, 290 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z9 = GUICtrlCreateCombo("", 100 * $stretch, 290 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z10 = GUICtrlCreateCombo("", 160 * $stretch, 290 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Do = GUICtrlCreateInput ("", 220 * $stretch, 290 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label7 = GUICtrlCreateLabel("Fr", 70 * $stretch, 320 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z11 = GUICtrlCreateCombo("", 100 * $stretch, 320 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z12 = GUICtrlCreateCombo("", 160 * $stretch, 320 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Fr = GUICtrlCreateInput ("", 220 * $stretch, 320 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label8 = GUICtrlCreateLabel("Sa", 70 * $stretch, 350 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z13 = GUICtrlCreateCombo("", 100 * $stretch, 350 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z14 = GUICtrlCreateCombo("", 160 * $stretch, 350 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Sa = GUICtrlCreateInput ("", 220 * $stretch, 350 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label9 = GUICtrlCreateLabel("So", 70 * $stretch, 380 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z15 = GUICtrlCreateCombo("", 100 * $stretch, 380 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z16 = GUICtrlCreateCombo("", 160 * $stretch, 380 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_So = GUICtrlCreateInput ("", 220 * $stretch, 380 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label11 = GUICtrlCreateLabel("von :", 100 * $stretch, 150 * $stretch, 25 * $stretch, 20 * $stretch)
Local $Label12 = GUICtrlCreateLabel("bis :", 160 * $stretch, 150 * $stretch, 25 * $stretch, 20 * $stretch)
Local $Label14 = GUICtrlCreateLabel("Maxtime :", 220 * $stretch, 150 * $stretch, 50 * $stretch, 20 * $stretch)
Local $Label13 = GUICtrlCreateLabel("von - bis gleich: nur MaxTime Einschränkung", 70 * $stretch, 420 * $stretch, 220 * $stretch, 20 * $stretch)
Local $Label14 = GUICtrlCreateLabel("MaxTime = 0 nur Anmeldezeiteinschränkung", 70 * $stretch, 440 * $stretch, 220 * $stretch, 20 * $stretch)
$btn = GUICtrlCreateButton ("Setzen", 65 * $stretch,480 * $stretch,50 * $stretch,30 * $stretch)
$btn1 = GUICtrlCreateButton ("Löschen", 150 * $stretch, 480 * $stretch, 50 * $stretch, 30 * $stretch)
$btn2 = GUICtrlCreateButton ("Abbruch", 235 * $stretch, 480 * $stretch, 50 * $stretch, 30 * $stretch)
GUISetOnEvent ($GUI_EVENT_CLOSE, "_Exit")
For $x = 1 to UBound ($arecords) - 1
if $arecords [$x] [1] = "" Then ExitLoop
_GUICtrlComboBox_AddString($hCombo, $arecords [$x] [1])
Next
_GUICtrlComboBox_SetCurSel ($hCombo, 0)
GUICtrlSetData ($hinput_MoSo, $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [2])
GUICtrlSetTip ($hinput_MoSo, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetOnEvent ($btn, "_restricted_time")
GUICtrlSetOnEvent ($btn1, "_dellogintime")
GUICtrlSetOnEvent ($btn2, "_exit")
$combochange = _GUICtrlComboBox_GetCurSel($hCombo)
_fillCombo_z ($Combo_z1)
_fillCombo_z ($Combo_z2)
_fillCombo_z ($Combo_z3)
_fillCombo_z ($Combo_z4)
_fillCombo_z ($Combo_z5)
_fillCombo_z ($Combo_z6)
_fillCombo_z ($Combo_z7)
_fillCombo_z ($Combo_z8)
_fillCombo_z ($Combo_z9)
_fillCombo_z ($Combo_z10)
_fillCombo_z ($Combo_z11)
_fillCombo_z ($Combo_z12)
_fillCombo_z ($Combo_z13)
_fillCombo_z ($Combo_z14)
_fillCombo_z ($Combo_z15)
_fillCombo_z ($Combo_z16)
GUICtrlSetData ($hinput_Mo, "0")
GUICtrlSetTip ($hinput_Mo, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Di, "0")
GUICtrlSetTip ($hinput_Di, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Mi, "0")
GUICtrlSetTip ($hinput_Mi, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Do, "0")
GUICtrlSetTip ($hinput_Do, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Fr, "0")
GUICtrlSetTip ($hinput_Fr, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Sa, "0")
GUICtrlSetTip ($hinput_Sa, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_So, "0")
GUICtrlSetTip ($hinput_So, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUISetState()
While 1
$nMsg = GUIGetMsg ()
$username = _GUICtrlComboBox_GetEditText ($hCombo)
$curselcheck = ControlCommand (WinGetTitle ("[LAST]",""),"","[CLASS:Button; INSTANCE:1]", "IsChecked", "" )
If $username <> $username1 Then
$username1 = $username
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay") <> "" Then
Local $anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z1, _GUICtrlComboBox_FindString ($Combo_z1, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z2, _GUICtrlComboBox_FindString ($Combo_z2, $anmeldezeit [2]))
GUICtrlSetData ($hinput_MoSo, $anmeldezeit [3])
GUICtrlSetData ($hinput_Mo, "0")
GUICtrlSetData ($hinput_Di, "0")
GUICtrlSetData ($hinput_Mi, "0")
GUICtrlSetData ($hinput_Do, "0")
GUICtrlSetData ($hinput_Fr, "0")
GUICtrlSetData ($hinput_Sa, "0")
GUICtrlSetData ($hinput_So, "0")
ControlCommand (WinGetTitle ("[LAST]",""),"","[CLASS:Button; INSTANCE:1]", "Check", "" )
Else
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1") <> "" Then
_GUICtrlComboBox_SetCurSel ($Combo_z1, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z2, 0)
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "2"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z5, _GUICtrlComboBox_FindString ($Combo_z5, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z6, _GUICtrlComboBox_FindString ($Combo_z6, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Mo, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Mo, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "3"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z3, _GUICtrlComboBox_FindString ($Combo_z3, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z4, _GUICtrlComboBox_FindString ($Combo_z4, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Di, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Di, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "4"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z7, _GUICtrlComboBox_FindString ($Combo_z7, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z8, _GUICtrlComboBox_FindString ($Combo_z8, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Mi, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Mi, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "5"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z9, _GUICtrlComboBox_FindString ($Combo_z9, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z10, _GUICtrlComboBox_FindString ($Combo_z10, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Do, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Do, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "6"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z11, _GUICtrlComboBox_FindString ($Combo_z11, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z12, _GUICtrlComboBox_FindString ($Combo_z12, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Fr, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Fr, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "7"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z13, _GUICtrlComboBox_FindString ($Combo_z13, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z14, _GUICtrlComboBox_FindString ($Combo_z14, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Sa, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Sa, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z15, _GUICtrlComboBox_FindString ($Combo_z15, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z16, _GUICtrlComboBox_FindString ($Combo_z16, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_So, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_So, "0")
EndIf
ControlCommand (WinGetTitle ("[LAST]",""),"","[CLASS:Button; INSTANCE:2]", "Check", "" )
Else
_GUICtrlComboBox_SetCurSel ($Combo_z1, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z2, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z5, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z6, 0)
GUICtrlSetData ($hinput_Mo, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z3, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z4, 0)
GUICtrlSetData ($hinput_Di, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z7, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z8, 0)
GUICtrlSetData ($hinput_Mi, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z9, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z10, 0)
GUICtrlSetData ($hinput_Do, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z11, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z12, 0)
GUICtrlSetData ($hinput_Fr, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z13, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z14, 0)
GUICtrlSetData ($hinput_Sa, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z15, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z16, 0)
GUICtrlSetData ($hinput_So, "0")
ControlCommand (WinGetTitle ("[LAST]",""),"","[CLASS:Button; INSTANCE:1]", "Check", "" )
EndIf
EndIf
EndIf
If $curselcheck = 1 And $checkradio <> $curselcheck Then
GUICtrlSetState ($Combo_z1, $GUI_ENABLE)
GUICtrlSetState ($Combo_z2, $GUI_ENABLE)
GUICtrlSetState ($hinput_MoSo, $GUI_ENABLE)
GUICtrlSetState ($Combo_z3, $GUI_DISABLE)
GUICtrlSetState ($Combo_z4, $GUI_DISABLE)
GUICtrlSetState ($Combo_z5, $GUI_DISABLE)
GUICtrlSetState ($Combo_z6, $GUI_DISABLE)
GUICtrlSetState ($Combo_z7, $GUI_DISABLE)
GUICtrlSetState ($Combo_z8, $GUI_DISABLE)
GUICtrlSetState ($Combo_z9, $GUI_DISABLE)
GUICtrlSetState ($Combo_z10, $GUI_DISABLE)
GUICtrlSetState ($Combo_z11, $GUI_DISABLE)
GUICtrlSetState ($Combo_z12, $GUI_DISABLE)
GUICtrlSetState ($Combo_z13, $GUI_DISABLE)
GUICtrlSetState ($Combo_z14, $GUI_DISABLE)
GUICtrlSetState ($Combo_z15, $GUI_DISABLE)
GUICtrlSetState ($Combo_z16, $GUI_DISABLE)
GUICtrlSetState ($hinput_Mo, $GUI_DISABLE)
GUICtrlSetState ($hinput_Di, $GUI_DISABLE)
GUICtrlSetState ($hinput_Mi, $GUI_DISABLE)
GUICtrlSetState ($hinput_Do, $GUI_DISABLE)
GUICtrlSetState ($hinput_Fr, $GUI_DISABLE)
GUICtrlSetState ($hinput_Sa, $GUI_DISABLE)
GUICtrlSetState ($hinput_So, $GUI_DISABLE)
$checkradio = $curselcheck
ElseIf $curselcheck = 0 And $checkradio <> $curselcheck Then
GUICtrlSetState ($Combo_z1, $GUI_DISABLE)
GUICtrlSetState ($Combo_z2, $GUI_DISABLE)
GUICtrlSetState ($hinput_MoSo, $GUI_DISABLE)
GUICtrlSetState ($Combo_z3, $GUI_ENABLE)
GUICtrlSetState ($Combo_z4, $GUI_ENABLE)
GUICtrlSetState ($Combo_z5, $GUI_ENABLE)
GUICtrlSetState ($Combo_z6, $GUI_ENABLE)
GUICtrlSetState ($Combo_z7, $GUI_ENABLE)
GUICtrlSetState ($Combo_z8, $GUI_ENABLE)
GUICtrlSetState ($Combo_z9, $GUI_ENABLE)
GUICtrlSetState ($Combo_z10, $GUI_ENABLE)
GUICtrlSetState ($Combo_z11, $GUI_ENABLE)
GUICtrlSetState ($Combo_z12, $GUI_ENABLE)
GUICtrlSetState ($Combo_z13, $GUI_ENABLE)
GUICtrlSetState ($Combo_z14, $GUI_ENABLE)
GUICtrlSetState ($Combo_z15, $GUI_ENABLE)
GUICtrlSetState ($Combo_z16, $GUI_ENABLE)
GUICtrlSetState ($hinput_Mo, $GUI_ENABLE)
GUICtrlSetState ($hinput_Di, $GUI_ENABLE)
GUICtrlSetState ($hinput_Mi, $GUI_ENABLE)
GUICtrlSetState ($hinput_Do, $GUI_ENABLE)
GUICtrlSetState ($hinput_Fr, $GUI_ENABLE)
GUICtrlSetState ($hinput_Sa, $GUI_ENABLE)
GUICtrlSetState ($hinput_So, $GUI_ENABLE)
$checkradio = $curselcheck
EndIf
If $curselcheck = 1 And $checkradio = $curselcheck Then
_checkCombo_z ($Combo_z1, $combo_z2)
EndIf
If $curselcheck = 0 And $checkradio = $curselcheck Then
_checkCombo_z ($Combo_z3, $combo_z4)
_checkCombo_z ($Combo_z5, $combo_z6)
_checkCombo_z ($Combo_z7, $combo_z8)
_checkCombo_z ($Combo_z9, $combo_z10)
_checkCombo_z ($Combo_z11, $combo_z12)
_checkCombo_z ($Combo_z13, $combo_z14)
_checkCombo_z ($Combo_z15, $combo_z16)
EndIf
If RegRead ("HKLM\Software\MaxTime\" & $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [1] & "\Restricted", "AllDay") = "" And _
RegRead ("HKLM\Software\MaxTime\" & $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [1] & "\Restricted", @WDAY) = "" Then
_GUICtrlButton_Enable($btn1, False)
WinSetTitle ($hgui, "", "Benutzer " & $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [1] & " ohne Restriktionen!")
Else
_GUICtrlButton_Enable($btn1, True)
WinSetTitle ($hgui, "", "Benutzer " & $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [1] & " mit Restriktionen!")
EndIf
$combochange1 = _GUICtrlComboBox_GetCurSel($hCombo)
If $combochange1 <> $combochange Then
;GUICtrlSetData ($hinput_MoSo, $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [2])
$combochange = _GUICtrlComboBox_GetCurSel($hCombo)
EndIf
Sleep (50)
WEndEndFunc
[/autoit]
; Setze Maximal Anmeldezeit MaxTime für ausgewählten User kopiere Link in Autostart
Func _setlogintime ()
Local $profpath
$profpath = StringReplace($profilepath, "Default User", GUICtrlRead ($hCombo))
If FileExists ($profpath) Then
If Not FileExists ($profpath & "\timerlog.lnk") Then
FileCreateShortcut(@ProgramFilesDir & "\Maxtime\" & @ScriptName, $profpath & "\timerlog.lnk")
EndIf
EndIf
;Exit
EndFunc
; Programmende
Func _exit ()
Exit
EndFunc
; Ergänze vorhandenes array mit lokalen Benutzern
; Lösche leere Inhalte
; Sortiere Array
Func _groupusers()
local $temparray, $f
if Not _FileReadToArray (@TempDir & "\benutzer.txt", $temparray) Then
MsgBox(4096,"Error", " Error reading " & @TempDir & "\benutzer.txt" & " to Array error:" & @error)
Exit
Else
;FileDelete (@TempDir & "\benutzer.txt")
For $i = 7 to UBound ($temparray) - 1
If Not StringInStr ($temparray [$i], "Der Befehl wurde erfolgreich ausgefÂhrt.") And _
Not StringInStr ($temparray [$i], "Aliasname") And _
Not StringInStr ($temparray [$i], "Beschreibung") And _
Not StringInStr ($temparray [$i], "Hauptbenutzer") And _
Not StringInStr ($temparray [$i], "Mitglieder") And _
Not StringInStr ($temparray [$i], "-----------------------------") Then
If Not StringInStr ($temparray [$i], "\") Then
For $x = 1 To UBound ($arecords) - 1
$f = StringInStr ($arecords [$x] [1], $temparray [$i])
If $f > 0 Then ExitLoop
Next
If $f = 0 Then
For $x = 1 To UBound ($arecords) - 1
If $arecords [$x] [1] <> "" Then
ContinueLoop
Else
$arecords [$x] [1] = $temparray [$i]
$arecords [$x] [2] = "60"
ExitLoop
EndIf
Next
EndIf
EndIf
Else
ContinueLoop
EndIf
Next
EndIf
_cleararray ()
_ArraySort ($arecords, 0, 1, 0, 1)
EndFunc
; Lösche Leere Inhalte aus Array
Func _cleararray ()
For $i = 1 To UBound ($arecords) -1
If $arecords [$i] [1] = "" Then
_ArrayDelete ($arecords, $i)
_cleararray ()
ExitLoop
EndIf
Next
EndFunc
; Löschen des Regeintrages HKLM\Software\MaxTime\<Username>
Func _dellogintime ()
$btnid = MsgBox (1, "Löschen der Restriktionen....", "Sollen die Einschränkungen von " & GUICtrlRead ($hCombo) & " gelöscht werden?")
If $btnid = 1 Then
RegDelete ("HKLM\Software\MaxTime\" & GUICtrlRead ($hCombo))
$arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [2] = "60"
GUICtrlSetData ($hinput_MoSo, $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [2])
EndIf
EndFunc
; Ermittlung der Schriftartgrösse ( 96 DPI / 120 DPI )
; Damit Steuerung der Grösse der GUI Elemente über globale Variable $stretch
Func _stretch ()
local $y
local $wbemFlagReturnImmediately = 0x10
local $wbemFlagForwardOnly = 0x20
local $strComputer = "."
local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_DesktopMonitor" _
, "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$y = $objItem.PixelsPerYLogicalInch
$stretch = ($objItem.PixelsPerYLogicalInch / 96)
Return
Next
EndIf
$stretch = "1,25"
EndFunc
;Füllen der Combos mit Anmeldezeiten
Func _fillCombo_z ($handle)
Local $y
For $y = 0 to 96
_GUICtrlComboBox_AddString($handle, $hourrecords [$y])
Next
_GUICtrlComboBox_SetCurSel ($handle, 0)
GUICtrlSetTip ($handle, "von : bis: gleich keine Einschränkung","",0,2)
EndFunc
;Fehlerüberprüfung bei den Anmeldezeiten
;Schreiben der Anmeldezeiten in Registry
Func _restricted_time ()
If $curselcheck = 1 Then
If _GUICtrlComboBox_GetEditText ($Combo_z1) > _GUICtrlComboBox_GetEditText ($Combo_z2) Then
MsgBox (0,"", "Fehler Zeitangabe Mo - So")
Return
Else
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z1) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z2) & ";" & GUICtrlRead ($hinput_MoSo))
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "2") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "2")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "3") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "3")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "4") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "4")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "5") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "5")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "6") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "6")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "7") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "7")
EndIf
Else
If _GUICtrlComboBox_GetEditText ($Combo_z5) > _GUICtrlComboBox_GetEditText ($Combo_z6) Then
MsgBox (0,"", "Fehler Zeitangabe Mo")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z3) > _GUICtrlComboBox_GetEditText ($Combo_z4) Then
MsgBox (0,"", "Fehler Zeitangabe Di")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z7) > _GUICtrlComboBox_GetEditText ($Combo_z8) Then
MsgBox (0,"", "Fehler Zeitangabe Mi")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z9) > _GUICtrlComboBox_GetEditText ($Combo_z10) Then
MsgBox (0,"", "Fehler Zeitangabe Do")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z11) > _GUICtrlComboBox_GetEditText ($Combo_z12) Then
MsgBox (0,"", "Fehler Zeitangabe Fr")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z13) > _GUICtrlComboBox_GetEditText ($Combo_z14) Then
MsgBox (0,"", "Fehler Zeitangabe Sa")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z15) > _GUICtrlComboBox_GetEditText ($Combo_z16) Then
MsgBox (0,"", "Fehler Zeitangabe Sa")
Return
EndIf
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay")
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "2", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z5) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z6) & ";" & GUICtrlRead ($hinput_Mo))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "3", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z3) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z4) & ";" & GUICtrlRead ($hinput_Di))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "4", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z7) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z8) & ";" & GUICtrlRead ($hinput_Mi))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "5", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z9) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z10) & ";" & GUICtrlRead ($hinput_Do))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "6", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z11) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z12) & ";" & GUICtrlRead ($hinput_Fr))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "7", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z13) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z14) & ";" & GUICtrlRead ($hinput_Sa))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z15) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z16) & ";" & GUICtrlRead ($hinput_So))
EndIf
_setlogintime ()
EndFunc
;Befülle Array mit den Anmeldezeiten
Func _fillarray ()
Local $y = 0
For $j = 0 to 23
For $x = 0 To 45 Step 15
If $j < 10 Then
If $x > 0 Then
$hourrecords [$y] = "0" & $j & ":" & $x
$y += 1
Else
$hourrecords [$y] = "0" & $j & ":" & "0" & $x
$y += 1
EndIf
Else
If $x > 0 Then
$hourrecords [$y] = $j & ":" & $x
$y += 1
Else
$hourrecords [$y] = $j & ":" & "0" & $x
$y += 1
EndIf
EndIf
Next
Next
$hourrecords [$y] = "keine"
EndFunc
Func _checkCombo_z ($handle, $handle1)
If _GUICtrlComboBox_GetEditText ($handle) = "keine" Then _GUICtrlComboBox_SetCurSel ($handle1, _GUICtrlComboBox_FindString ($handle1, "keine"))
EndFuncMoin,
ich habe ein Zeitkontrollprogramm mit folgenden Funktionen:
1) Auslesen der Lokalen Benutzergruppe
2) Setzen von Anmeldezeiten So - Sa
3) Setzen von max. Zeit am Computer. Entweder fest für alle Tage oder versch. Zeiten für versch. Tage.
;-))
Stefan
-
Also ich werde ein Mathe-Programm machen.
-
ich würde mich um den Computerzeitenüberwacher kümmern Sag mir einfach bescheid falls ich das machen soll
-
Wieder aktualisiert
Siehe 1# Post!Natürlich können bei jedem Projekt so viele mitmachen , wie möchten.
Auch für Ideen für andere Kinderprogramme bin ich jederzeit offen! -
Hi, gut Idee, ich bin dabei ... gui oder Script egal ich beis mich durch alles ... ich muss mir hier ja auch immer meine Thrats selbst beantworten 8|. Aber wünsche wäre ne Tolle Sache ich entwickle Problem Orientiert (kein Problem, keine Losung, kein Script).
-
Maximale Zeit und weitere Anmelderestriktionen
Dies ist das, was ich bis dato habe. Funktioniert, wie gesagt, nur für normale Benutzer. Falls ein Admin die Exe aufruft, können entsprechende Parameter für die User gesetzt werden. Wichtig: User muss schon vorhanden sein!
Spoiler anzeigen
[autoit]
[/autoit]
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=timerlog_test.exe
#AutoIt3Wrapper_Res_Comment=Setze Maximale Zeit, die ein Benutzer angemeldet sein darf
#AutoIt3Wrapper_Res_Fileversion=1.0.0.11
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Date.au3>
#include <GuiButton.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#Include <GuiComboBox.au3>
#include <file.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
;Variablendeklaration
Global $date, $datereg, $maxtime, $zaehler, $hgui, $hinput_MoSo,$btn, $btn1, $btn2, $btn3, $label, $hcombo, $label1, $arecords [1] [3], $profilepath, $stretch
Global $Combo_z1, $Combo_z2, $Combo_z3, $Combo_z4, $Combo_z5, $Combo_z6, $Combo_z7, $Combo_z8, $Combo_z9, $Combo_z10, $Combo_z11, $Combo_z12, $Combo_z13
Global $Combo_z14, $Combo_z15, $Combo_z16, $curselcheck, $username, $combochange, $combochange1, $Form1, $Radio1, $Radio2, $Group1, $Save, $Abbruch, $nMsg
Global $hourrecords [97], $logintime, $hinput_Mo, $hinput_Di, $hinput_Mi, $hinput_Do, $hinput_Fr, $hinput_Sa, $hinput_So, $timenow,$logintime1, $logintime2
Global $blogoff, $btnid
;Optionen
Opt("TrayIconHide", 1)
Opt("GUIOnEventMode", 1)
Opt('MustDeclareVars', 1)
; Ergänzung für MS Tool Steady State
; Für lokale User können maximale Rechnerzeit pro Tag eingetragen werden
; Steuerung für Beschränkung über HKLM\Software\MaxTime\<Username>\Restricted Anmeldezeit1;Anmeldezeit2;MaxTime
; Steurung für Überprüfung MaxTime über HKCU\Software\MaxTime Datum und Zaehler
; WMI Abfrage scheidet aus, wegen Domäne
;Administration mit Parameter init
;##### Main ###########################
If IsAdmin () Then
_initadmin ()
_groupusers ()
_gui_settings ()
Else
_init ()
If $blogoff = True Then _checklogintime ()
EndIf
;##### Main ###########################
;##### Funktionen #####################
; Optionale Parameter Komponente für Initialisierung; wird z.Zt nicht genutzt.
Func _check_cmd_admin ()
If IsAdmin () Then
If $CmdLine[0] > 0 Then
If $CmdLine [1] = "init" Then
_initadmin ()
Else
MsgBox (0,"Falscher Aufruf für Administration","Administrativer Aufruf mit Parameter init !", 5)
Exit
EndIf
Else
MsgBox (0,"Falscher Aufruf für Administration","Administrativer Aufruf mit Parameter init !", 5)
Exit
EndIf
EndIf
EndFunc
; Aufruf wenn User Admin
; Auslesen der Schriftarten Grösse
; Lies bis zu 100 Schlüssel unterhalb von HKLM\Software\Maxtime aus und lies in Array
; Lies über DOS Command Mitglieder von Benutzer aus
; Befülle 2D - Array mit Usernamen und MaxLogonTime
Func _initadmin ()
Local $btnid, $f, $i, $var
_stretch ()
$profilepath = StringReplace(@StartupDir, @UserName, "Default User")
If Not FileExists (@ProgramFilesDir & "\Maxtime\timerlog.exe") Then
$btnid = MsgBox (0, "Timerlog Initialisierung....", "Programmverzeichnis wird erzeugt und Datei kopiert!")
_initapp ()
EndIf
If Not FileExists ($profilepath & "\timerlog.lnk") Then
$btnid = MsgBox (1, "Timerlog Initialisierung....", "Verlinke Timerlog Autostart für Default User?")
If $btnid <> 2 Then FileCreateShortcut(@ProgramFilesDir & "\" & @ScriptName, $profilepath & "\timerlog.lnk")
EndIf
$f = 0
For $i= 1 to 100
$var = RegEnumKey("HKLM\Software\Maxtime", $i)
If @error <> 0 then ExitLoop
$f = $f + 1
Next
RunWait (@ComSpec & " /c " & "net localgroup Benutzer > """ & @TempDir & "\benutzer.txt""")
RunWait (@ComSpec & " /c " & "net localgroup Hauptbenutzer >> """ & @TempDir & "\benutzer.txt""")
$f = $f + _FileCountLines (@TempDir & "\benutzer.txt") - 8
ReDim $arecords [$f] [3]
For $i= 1 to 100
$var = RegEnumKey("HKLM\Software\Maxtime", $i)
If @error <> 0 then ExitLoop
$arecords [$i] [1] = $var
If Not RegRead ("HKLM\Software\MaxTime\" & $arecords [$i] [1], "MaxLogonTime") = 1 Then
$arecords [$i] [2] = "0"
Else
$arecords [$i] [2] = RegRead ("HKLM\Software\MaxTime\" & $arecords [$i] [1], "MaxLogonTime")
EndIf
Next
_fillarray ()
EndFunc
Func _initapp ()
FileCopy (@ScriptFullPath, @ProgramFilesDir & "\Maxtime\timerlog_.exe",8)
FileCreateShortcut(@ProgramFilesDir & "\Maxtime\timerlog_.exe", @DesktopDir & "\timerlog_.lnk")
EndFunc
; Aufruf wenn User ist Benutzer, Initialisierung der erforderlichen Parameter
; Lies lokales Datum aus
; Lies Anmelderestriktionen aus Registry HKLM\Software\MaxTime\<Username>\Restricted Anmeldezeit1;Anmeldezeit2;MaxTime
; Falls Anmeldezeit1 <> Anmeldezeit2 überprüfe ob Anmeldung innerhalb erlaubter Zeit; wenn nicht Abmeldung
; Wenn Datum in HKCU\Software\Maxtime Datum ungleich heutiges Datum -> Setze Datum in Regkey, Setze Zähler auf 1
; -> Ansonsten lies HKCU\Software\Maxtime Zähler aus
; Wenn Zähler = MaxTime dann Abmeldung
Func _init ()
$blogoff = True
$date = _NowDate ()
$timenow = StringSplit (_NowTime (4), ":")
$zaehler = 1
If RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", "AllDay") <> "" Then
$logintime = StringSplit (RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", "AllDay"), ";")
$maxtime = Number ($logintime [3])
If $logintime [1] = "keine" Then
MsgBox (0,"Anmeldung nicht erlaubt....","Anmeldung z. Zt. nicht erlaubt!",10)
_logoff ()
EndIf
If $logintime [1] <> $logintime [2] Then
$logintime1 = StringSplit ($logintime [1], ":")
$logintime2 = StringSplit ($logintime [2], ":")
If Number ($timenow [1]) < Number ($logintime1 [1]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
Else
If Number ($timenow [1]) = Number ($logintime1 [1]) Then
If Number ($timenow [2]) < Number ($logintime1 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
Else
If Number ($timenow [2]) > Number ($logintime1 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
Else
If Number ($timenow [1]) = Number ($logintime2 [1]) Then
If Number ($timenow [2]) >= Number ($logintime2 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
EndIf
EndIf
EndIf
EndIf
Else
If $maxtime = 0 Then Exit
EndIf
Else
If RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", @WDAY) <> "" Then
$logintime = StringSplit (RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", @WDAY), ";")
$maxtime = Number ($logintime [3])
If $logintime [1] = "keine" Then
MsgBox (0,"Anmeldung nicht erlaubt....","Anmeldung z. Zt. nicht erlaubt!",10)
_logoff ()
EndIf
If $logintime [1] <> $logintime [2] Then
$logintime1 = StringSplit ($logintime [1], ":")
$logintime2 = StringSplit ($logintime [2], ":")
If Number ($timenow [1]) < Number ($logintime1 [1]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
Else
If Number ($timenow [1]) = Number ($logintime1 [1]) Then
If Number ($timenow [2]) < Number ($logintime1 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
Else
If Number ($timenow [2]) < Number ($logintime1 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
Else
If Number ($timenow [1]) = Number ($logintime2 [1]) Then
If Number ($timenow [2]) >= Number ($logintime2 [2]) Then
MsgBox (0,"Anmeldung nicht erlaubt....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
EndIf
EndIf
EndIf
EndIf
Else
If $maxtime = 0 Then Exit
EndIf
EndIf
EndIf
If RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", "AllDay") = "" Then
If RegRead ("HKLM\Software\MaxTime\" & @UserName & "\Restricted", @WDAY) = "" Then Exit
EndIf
If RegRead ("HKEY_CURRENT_USER\Software\MaxTime", "Datum") = "" Then
RegWrite ("HKCU\Software\MaxTime", "Datum", "REG_SZ", $date)
Else
$datereg = RegRead ("HKEY_CURRENT_USER\Software\MaxTime", "Datum")
EndIf
If $datereg <> $date Then
RegWrite ("HKEY_CURRENT_USER\Software\MaxTime", "Zaehler", "REG_SZ", "1")
RegWrite ("HKCU\Software\MaxTime", "Datum", "REG_SZ", $date)
Else
If RegRead ("HKEY_CURRENT_USER\Software\MaxTime", "Zaehler") <> 1 Then
$zaehler = Number (RegRead ("HKEY_CURRENT_USER\Software\MaxTime", "Zaehler"))
EndIf
EndIf
If $maxtime > 0 Then
If $zaehler >= $maxtime Then
MsgBox (0,"Zulässige Anmeldezeit überschritten...", "Zulässige Anmeldezeit von " & $maxtime & " Minuten überschritten!", 10)
_logoff ()
EndIf
EndIf
EndFunc
; Überprüfung, ob Anmeldezeit überschritten
; Wenn Zähler = MaxTime Abmeldung
Func _checklogintime ()
If $maxtime > 0 Then
For $i = $zaehler to $maxtime
RegWrite ("HKEY_CURRENT_USER\Software\MaxTime", "Zaehler", "REG_SZ", $i)
If $logintime [1] <> $logintime [2] Then
$timenow = StringSplit (_NowTime (4), ":")
If $logintime2 [1] = $timenow [1] And $logintime2 [2] = $timenow [2] Then
MsgBox (0,"Anmeldezeit abgelaufen....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
ExitLoop
EndIf
EndIf
If $i = $maxtime Then ExitLoop
Sleep (60000)
Next
_logoff ()
Else
If $logintime [1] <> $logintime [2] Then
$timenow = StringSplit (_NowTime (4), ":")
If $logintime2 [1] = $timenow [1] And $logintime2 [2] = $timenow [2] Then
MsgBox (0,"Anmeldezeit abgelaufen....", "Anmeldung nur zwischen " & $logintime [1] & " und " & $logintime [2] & " erlaubt!", 10)
_logoff ()
EndIf
EndIf
EndIf
EndFunc
;Abmeldung
Func _logoff ()
$blogoff = False
MsgBox (0,"Autom. LogOff....", "Abmeldung erfolgt in max. 10 Sek.....", 10)
Shutdown (0)
EndFunc
; Erzeuge Gui
; Räum Array auf
; Sortiere Array
; Befülle ComboBox
; Setze Events für Buttons
; While Schleife: Wenn User für MaxTime eingetragen ist, aktiviere Löschen Button -> Ansonsten Lösche Button deaktiviert
; Befülle Input Feld mit entsprechedem MaxTime Eintrag aus Array
Func _gui_settings ()
Local $username1, $anmeldezeit, $checkradio
$hgui = GUICreate("Einstellungen Maximale Anmeldezeit", 350 * $stretch, 550 * $stretch, -1, -1, $WS_Border, $WS_EX_CLIENTEDGE )
$hcombo = GUICtrlCreateCombo ("", 130 * $stretch, 20 * $stretch, 120 * $stretch,40 * $stretch)
$label = GUICtrlCreateLabel ("User :", 30 * $stretch, 20 * $stretch, 80 * $stretch)
;$label1 = GUICtrlCreateLabel ("MaxLogonTime :", 30 * $stretch, 40 * $stretch, 80 * $stretch)
$Radio1 = GUICtrlCreateRadio("An allen Tagen gleich", 50 * $stretch, 95 * $stretch, 145 * $stretch, 20 * $stretch)
GUICtrlSetState($Radio1, $GUI_CHECKED)
$Radio2 = GUICtrlCreateRadio("unterschiedlich", 50 * $stretch, 125 * $stretch, 145 * $stretch, 20 * $stretch)
$Group1 = GUICtrlCreateGroup("Anmeldezeiten", 30 * $stretch, 75 * $stretch, 280 * $stretch, 390 * $stretch)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Local $Label3 = GUICtrlCreateLabel("Mo - So", 50 * $stretch, 170 * $stretch, 50 * $stretch, 17 * $stretch)
$Combo_z1 = GUICtrlCreateCombo("", 100 * $stretch, 170 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z2 = GUICtrlCreateCombo("", 160 * $stretch, 170 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_MoSo = GUICtrlCreateInput ("", 220 * $stretch, 170 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label4 = GUICtrlCreateLabel("Mo", 70 * $stretch, 200 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z5 = GUICtrlCreateCombo("", 100 * $stretch, 200 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z6 = GUICtrlCreateCombo("", 160 * $stretch, 200 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Mo = GUICtrlCreateInput ("", 220 * $stretch, 200 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label2 = GUICtrlCreateLabel("Di", 70 * $stretch, 230 * $stretch, 14 * $stretch, 17 * $stretch)
$Combo_z3 = GUICtrlCreateCombo("", 100 * $stretch, 230 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z4 = GUICtrlCreateCombo("", 160 * $stretch, 230 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Di = GUICtrlCreateInput ("", 220 * $stretch, 230 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label5 = GUICtrlCreateLabel("Mi", 70 * $stretch, 260 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z7 = GUICtrlCreateCombo("", 100 * $stretch, 260 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z8 = GUICtrlCreateCombo("", 160 * $stretch, 260 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Mi = GUICtrlCreateInput ("", 220 * $stretch, 260 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label6 = GUICtrlCreateLabel("Do", 70 * $stretch, 290 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z9 = GUICtrlCreateCombo("", 100 * $stretch, 290 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z10 = GUICtrlCreateCombo("", 160 * $stretch, 290 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Do = GUICtrlCreateInput ("", 220 * $stretch, 290 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label7 = GUICtrlCreateLabel("Fr", 70 * $stretch, 320 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z11 = GUICtrlCreateCombo("", 100 * $stretch, 320 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z12 = GUICtrlCreateCombo("", 160 * $stretch, 320 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Fr = GUICtrlCreateInput ("", 220 * $stretch, 320 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label8 = GUICtrlCreateLabel("Sa", 70 * $stretch, 350 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z13 = GUICtrlCreateCombo("", 100 * $stretch, 350 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z14 = GUICtrlCreateCombo("", 160 * $stretch, 350 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_Sa = GUICtrlCreateInput ("", 220 * $stretch, 350 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label9 = GUICtrlCreateLabel("So", 70 * $stretch, 380 * $stretch, 20 * $stretch, 20 * $stretch)
$Combo_z15 = GUICtrlCreateCombo("", 100 * $stretch, 380 * $stretch, 50 * $stretch, 80 * $stretch)
$Combo_z16 = GUICtrlCreateCombo("", 160 * $stretch, 380 * $stretch, 50 * $stretch, 80 * $stretch)
$hinput_So = GUICtrlCreateInput ("", 220 * $stretch, 380 * $stretch, 40 * $stretch,20 * $stretch)
Local $Label11 = GUICtrlCreateLabel("von :", 100 * $stretch, 150 * $stretch, 25 * $stretch, 20 * $stretch)
Local $Label12 = GUICtrlCreateLabel("bis :", 160 * $stretch, 150 * $stretch, 25 * $stretch, 20 * $stretch)
Local $Label14 = GUICtrlCreateLabel("Maxtime :", 220 * $stretch, 150 * $stretch, 50 * $stretch, 20 * $stretch)
Local $Label13 = GUICtrlCreateLabel("von - bis gleich: nur MaxTime Einschränkung", 70 * $stretch, 420 * $stretch, 220 * $stretch, 20 * $stretch)
Local $Label14 = GUICtrlCreateLabel("MaxTime = 0 nur Anmeldezeiteinschränkung", 70 * $stretch, 440 * $stretch, 220 * $stretch, 20 * $stretch)
$btn = GUICtrlCreateButton ("Setzen", 65 * $stretch,480 * $stretch,50 * $stretch,30 * $stretch)
$btn1 = GUICtrlCreateButton ("Löschen", 150 * $stretch, 480 * $stretch, 50 * $stretch, 30 * $stretch)
$btn2 = GUICtrlCreateButton ("Abbruch", 235 * $stretch, 480 * $stretch, 50 * $stretch, 30 * $stretch)
GUISetOnEvent ($GUI_EVENT_CLOSE, "_Exit")
For $x = 1 to UBound ($arecords) - 1
if $arecords [$x] [1] = "" Then ExitLoop
_GUICtrlComboBox_AddString($hCombo, $arecords [$x] [1])
Next
_GUICtrlComboBox_SetCurSel ($hCombo, 0)
GUICtrlSetData ($hinput_MoSo, $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [2])
GUICtrlSetTip ($hinput_MoSo, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetOnEvent ($btn, "_restricted_time")
GUICtrlSetOnEvent ($btn1, "_dellogintime")
GUICtrlSetOnEvent ($btn2, "_exit")
$combochange = _GUICtrlComboBox_GetCurSel($hCombo)
_fillCombo_z ($Combo_z1)
_fillCombo_z ($Combo_z2)
_fillCombo_z ($Combo_z3)
_fillCombo_z ($Combo_z4)
_fillCombo_z ($Combo_z5)
_fillCombo_z ($Combo_z6)
_fillCombo_z ($Combo_z7)
_fillCombo_z ($Combo_z8)
_fillCombo_z ($Combo_z9)
_fillCombo_z ($Combo_z10)
_fillCombo_z ($Combo_z11)
_fillCombo_z ($Combo_z12)
_fillCombo_z ($Combo_z13)
_fillCombo_z ($Combo_z14)
_fillCombo_z ($Combo_z15)
_fillCombo_z ($Combo_z16)
GUICtrlSetData ($hinput_Mo, "0")
GUICtrlSetTip ($hinput_Mo, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Di, "0")
GUICtrlSetTip ($hinput_Di, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Mi, "0")
GUICtrlSetTip ($hinput_Mi, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Do, "0")
GUICtrlSetTip ($hinput_Do, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Fr, "0")
GUICtrlSetTip ($hinput_Fr, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_Sa, "0")
GUICtrlSetTip ($hinput_Sa, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUICtrlSetData ($hinput_So, "0")
GUICtrlSetTip ($hinput_So, "0 nur Anmeldezeitenbeschränkung","",0,2)
GUISetState()
While 1
$nMsg = GUIGetMsg ()
$username = _GUICtrlComboBox_GetEditText ($hCombo)
$curselcheck = ControlCommand (WinGetTitle ("[LAST]",""),"","[CLASS:Button; INSTANCE:1]", "IsChecked", "" )
If $username <> $username1 Then
$username1 = $username
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay") <> "" Then
Local $anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z1, _GUICtrlComboBox_FindString ($Combo_z1, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z2, _GUICtrlComboBox_FindString ($Combo_z2, $anmeldezeit [2]))
GUICtrlSetData ($hinput_MoSo, $anmeldezeit [3])
GUICtrlSetData ($hinput_Mo, "0")
GUICtrlSetData ($hinput_Di, "0")
GUICtrlSetData ($hinput_Mi, "0")
GUICtrlSetData ($hinput_Do, "0")
GUICtrlSetData ($hinput_Fr, "0")
GUICtrlSetData ($hinput_Sa, "0")
GUICtrlSetData ($hinput_So, "0")
ControlCommand (WinGetTitle ("[LAST]",""),"","[CLASS:Button; INSTANCE:1]", "Check", "" )
Else
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1") <> "" Then
_GUICtrlComboBox_SetCurSel ($Combo_z1, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z2, 0)
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "2"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z5, _GUICtrlComboBox_FindString ($Combo_z5, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z6, _GUICtrlComboBox_FindString ($Combo_z6, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Mo, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Mo, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "3"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z3, _GUICtrlComboBox_FindString ($Combo_z3, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z4, _GUICtrlComboBox_FindString ($Combo_z4, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Di, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Di, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "4"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z7, _GUICtrlComboBox_FindString ($Combo_z7, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z8, _GUICtrlComboBox_FindString ($Combo_z8, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Mi, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Mi, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "5"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z9, _GUICtrlComboBox_FindString ($Combo_z9, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z10, _GUICtrlComboBox_FindString ($Combo_z10, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Do, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Do, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "6"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z11, _GUICtrlComboBox_FindString ($Combo_z11, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z12, _GUICtrlComboBox_FindString ($Combo_z12, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Fr, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Fr, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "7"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z13, _GUICtrlComboBox_FindString ($Combo_z13, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z14, _GUICtrlComboBox_FindString ($Combo_z14, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_Sa, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_Sa, "0")
EndIf
$anmeldezeit = StringSplit (RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1"), ";")
_GUICtrlComboBox_SetCurSel ($Combo_z15, _GUICtrlComboBox_FindString ($Combo_z15, $anmeldezeit [1]))
_GUICtrlComboBox_SetCurSel ($Combo_z16, _GUICtrlComboBox_FindString ($Combo_z16, $anmeldezeit [2]))
If $anmeldezeit [0] > 2 Then
GUICtrlSetData ($hinput_So, $anmeldezeit [3])
Else
GUICtrlSetData ($hinput_So, "0")
EndIf
ControlCommand (WinGetTitle ("[LAST]",""),"","[CLASS:Button; INSTANCE:2]", "Check", "" )
Else
_GUICtrlComboBox_SetCurSel ($Combo_z1, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z2, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z5, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z6, 0)
GUICtrlSetData ($hinput_Mo, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z3, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z4, 0)
GUICtrlSetData ($hinput_Di, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z7, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z8, 0)
GUICtrlSetData ($hinput_Mi, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z9, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z10, 0)
GUICtrlSetData ($hinput_Do, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z11, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z12, 0)
GUICtrlSetData ($hinput_Fr, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z13, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z14, 0)
GUICtrlSetData ($hinput_Sa, "0")
_GUICtrlComboBox_SetCurSel ($Combo_z15, 0)
_GUICtrlComboBox_SetCurSel ($Combo_z16, 0)
GUICtrlSetData ($hinput_So, "0")
ControlCommand (WinGetTitle ("[LAST]",""),"","[CLASS:Button; INSTANCE:1]", "Check", "" )
EndIf
EndIf
EndIf
If $curselcheck = 1 And $checkradio <> $curselcheck Then
GUICtrlSetState ($Combo_z1, $GUI_ENABLE)
GUICtrlSetState ($Combo_z2, $GUI_ENABLE)
GUICtrlSetState ($hinput_MoSo, $GUI_ENABLE)
GUICtrlSetState ($Combo_z3, $GUI_DISABLE)
GUICtrlSetState ($Combo_z4, $GUI_DISABLE)
GUICtrlSetState ($Combo_z5, $GUI_DISABLE)
GUICtrlSetState ($Combo_z6, $GUI_DISABLE)
GUICtrlSetState ($Combo_z7, $GUI_DISABLE)
GUICtrlSetState ($Combo_z8, $GUI_DISABLE)
GUICtrlSetState ($Combo_z9, $GUI_DISABLE)
GUICtrlSetState ($Combo_z10, $GUI_DISABLE)
GUICtrlSetState ($Combo_z11, $GUI_DISABLE)
GUICtrlSetState ($Combo_z12, $GUI_DISABLE)
GUICtrlSetState ($Combo_z13, $GUI_DISABLE)
GUICtrlSetState ($Combo_z14, $GUI_DISABLE)
GUICtrlSetState ($Combo_z15, $GUI_DISABLE)
GUICtrlSetState ($Combo_z16, $GUI_DISABLE)
GUICtrlSetState ($hinput_Mo, $GUI_DISABLE)
GUICtrlSetState ($hinput_Di, $GUI_DISABLE)
GUICtrlSetState ($hinput_Mi, $GUI_DISABLE)
GUICtrlSetState ($hinput_Do, $GUI_DISABLE)
GUICtrlSetState ($hinput_Fr, $GUI_DISABLE)
GUICtrlSetState ($hinput_Sa, $GUI_DISABLE)
GUICtrlSetState ($hinput_So, $GUI_DISABLE)
$checkradio = $curselcheck
ElseIf $curselcheck = 0 And $checkradio <> $curselcheck Then
GUICtrlSetState ($Combo_z1, $GUI_DISABLE)
GUICtrlSetState ($Combo_z2, $GUI_DISABLE)
GUICtrlSetState ($hinput_MoSo, $GUI_DISABLE)
GUICtrlSetState ($Combo_z3, $GUI_ENABLE)
GUICtrlSetState ($Combo_z4, $GUI_ENABLE)
GUICtrlSetState ($Combo_z5, $GUI_ENABLE)
GUICtrlSetState ($Combo_z6, $GUI_ENABLE)
GUICtrlSetState ($Combo_z7, $GUI_ENABLE)
GUICtrlSetState ($Combo_z8, $GUI_ENABLE)
GUICtrlSetState ($Combo_z9, $GUI_ENABLE)
GUICtrlSetState ($Combo_z10, $GUI_ENABLE)
GUICtrlSetState ($Combo_z11, $GUI_ENABLE)
GUICtrlSetState ($Combo_z12, $GUI_ENABLE)
GUICtrlSetState ($Combo_z13, $GUI_ENABLE)
GUICtrlSetState ($Combo_z14, $GUI_ENABLE)
GUICtrlSetState ($Combo_z15, $GUI_ENABLE)
GUICtrlSetState ($Combo_z16, $GUI_ENABLE)
GUICtrlSetState ($hinput_Mo, $GUI_ENABLE)
GUICtrlSetState ($hinput_Di, $GUI_ENABLE)
GUICtrlSetState ($hinput_Mi, $GUI_ENABLE)
GUICtrlSetState ($hinput_Do, $GUI_ENABLE)
GUICtrlSetState ($hinput_Fr, $GUI_ENABLE)
GUICtrlSetState ($hinput_Sa, $GUI_ENABLE)
GUICtrlSetState ($hinput_So, $GUI_ENABLE)
$checkradio = $curselcheck
EndIf
If $curselcheck = 1 And $checkradio = $curselcheck Then
_checkCombo_z ($Combo_z1, $combo_z2)
EndIf
If $curselcheck = 0 And $checkradio = $curselcheck Then
_checkCombo_z ($Combo_z3, $combo_z4)
_checkCombo_z ($Combo_z5, $combo_z6)
_checkCombo_z ($Combo_z7, $combo_z8)
_checkCombo_z ($Combo_z9, $combo_z10)
_checkCombo_z ($Combo_z11, $combo_z12)
_checkCombo_z ($Combo_z13, $combo_z14)
_checkCombo_z ($Combo_z15, $combo_z16)
EndIf
If RegRead ("HKLM\Software\MaxTime\" & $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [1] & "\Restricted", "AllDay") = "" And _
RegRead ("HKLM\Software\MaxTime\" & $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [1] & "\Restricted", @WDAY) = "" Then
_GUICtrlButton_Enable($btn1, False)
WinSetTitle ($hgui, "", "Benutzer " & $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [1] & " ohne Restriktionen!")
Else
_GUICtrlButton_Enable($btn1, True)
WinSetTitle ($hgui, "", "Benutzer " & $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [1] & " mit Restriktionen!")
EndIf
$combochange1 = _GUICtrlComboBox_GetCurSel($hCombo)
If $combochange1 <> $combochange Then
;GUICtrlSetData ($hinput_MoSo, $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [2])
$combochange = _GUICtrlComboBox_GetCurSel($hCombo)
EndIf
Sleep (50)
WEnd
EndFunc
; Setze Maximal Anmeldezeit MaxTime für ausgewählten User kopiere Link in Autostart
Func _setlogintime ()
Local $profpath
$profpath = StringReplace($profilepath, "Default User", GUICtrlRead ($hCombo))
If FileExists ($profpath) Then
If Not FileExists ($profpath & "\timerlog.lnk") Then
FileCreateShortcut(@ProgramFilesDir & "\Maxtime\" & @ScriptName, $profpath & "\timerlog.lnk")
EndIf
EndIf
;Exit
EndFunc
; Programmende
Func _exit ()
Exit
EndFunc
; Ergänze vorhandenes array mit lokalen Benutzern
; Lösche leere Inhalte
; Sortiere Array
Func _groupusers()
local $temparray, $f
if Not _FileReadToArray (@TempDir & "\benutzer.txt", $temparray) Then
MsgBox(4096,"Error", " Error reading " & @TempDir & "\benutzer.txt" & " to Array error:" & @error)
Exit
Else
;FileDelete (@TempDir & "\benutzer.txt")
For $i = 7 to UBound ($temparray) - 1
If Not StringInStr ($temparray [$i], "Der Befehl wurde erfolgreich ausgefhrt.") And _
Not StringInStr ($temparray [$i], "Aliasname") And _
Not StringInStr ($temparray [$i], "Beschreibung") And _
Not StringInStr ($temparray [$i], "Hauptbenutzer") And _
Not StringInStr ($temparray [$i], "Mitglieder") And _
Not StringInStr ($temparray [$i], "-----------------------------") Then
If Not StringInStr ($temparray [$i], "\") Then
For $x = 1 To UBound ($arecords) - 1
$f = StringInStr ($arecords [$x] [1], $temparray [$i])
If $f > 0 Then ExitLoop
Next
If $f = 0 Then
For $x = 1 To UBound ($arecords) - 1
If $arecords [$x] [1] <> "" Then
ContinueLoop
Else
$arecords [$x] [1] = $temparray [$i]
$arecords [$x] [2] = "60"
ExitLoop
EndIf
Next
EndIf
EndIf
Else
ContinueLoop
EndIf
Next
EndIf
_cleararray ()
_ArraySort ($arecords, 0, 1, 0, 1)
EndFunc
; Lösche Leere Inhalte aus Array
Func _cleararray ()
For $i = 1 To UBound ($arecords) -1
If $arecords [$i] [1] = "" Then
_ArrayDelete ($arecords, $i)
_cleararray ()
ExitLoop
EndIf
Next
EndFunc
; Löschen des Regeintrages HKLM\Software\MaxTime\<Username>
Func _dellogintime ()
$btnid = MsgBox (1, "Löschen der Restriktionen....", "Sollen die Einschränkungen von " & GUICtrlRead ($hCombo) & " gelöscht werden?")
If $btnid = 1 Then
RegDelete ("HKLM\Software\MaxTime\" & GUICtrlRead ($hCombo))
$arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [2] = "60"
GUICtrlSetData ($hinput_MoSo, $arecords [_GUICtrlComboBox_GetCurSel($hCombo) + 1] [2])
EndIf
EndFunc
; Ermittlung der Schriftartgrösse ( 96 DPI / 120 DPI )
; Damit Steuerung der Grösse der GUI Elemente über globale Variable $stretch
Func _stretch ()
local $y
local $wbemFlagReturnImmediately = 0x10
local $wbemFlagForwardOnly = 0x20
local $strComputer = "."
local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_DesktopMonitor" _
, "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$y = $objItem.PixelsPerYLogicalInch
$stretch = ($objItem.PixelsPerYLogicalInch / 96)
Return
Next
EndIf
$stretch = "1,25"
EndFunc
;Füllen der Combos mit Anmeldezeiten
Func _fillCombo_z ($handle)
Local $y
For $y = 0 to 96
_GUICtrlComboBox_AddString($handle, $hourrecords [$y])
Next
_GUICtrlComboBox_SetCurSel ($handle, 0)
GUICtrlSetTip ($handle, "von : bis: gleich keine Einschränkung","",0,2)
EndFunc
;Fehlerüberprüfung bei den Anmeldezeiten
;Schreiben der Anmeldezeiten in Registry
Func _restricted_time ()
If $curselcheck = 1 Then
If _GUICtrlComboBox_GetEditText ($Combo_z1) > _GUICtrlComboBox_GetEditText ($Combo_z2) Then
MsgBox (0,"", "Fehler Zeitangabe Mo - So")
Return
Else
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z1) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z2) & ";" & GUICtrlRead ($hinput_MoSo))
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "2") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "2")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "3") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "3")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "4") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "4")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "5") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "5")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "6") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "6")
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "7") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "7")
EndIf
Else
If _GUICtrlComboBox_GetEditText ($Combo_z5) > _GUICtrlComboBox_GetEditText ($Combo_z6) Then
MsgBox (0,"", "Fehler Zeitangabe Mo")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z3) > _GUICtrlComboBox_GetEditText ($Combo_z4) Then
MsgBox (0,"", "Fehler Zeitangabe Di")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z7) > _GUICtrlComboBox_GetEditText ($Combo_z8) Then
MsgBox (0,"", "Fehler Zeitangabe Mi")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z9) > _GUICtrlComboBox_GetEditText ($Combo_z10) Then
MsgBox (0,"", "Fehler Zeitangabe Do")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z11) > _GUICtrlComboBox_GetEditText ($Combo_z12) Then
MsgBox (0,"", "Fehler Zeitangabe Fr")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z13) > _GUICtrlComboBox_GetEditText ($Combo_z14) Then
MsgBox (0,"", "Fehler Zeitangabe Sa")
Return
EndIf
If _GUICtrlComboBox_GetEditText ($Combo_z15) > _GUICtrlComboBox_GetEditText ($Combo_z16) Then
MsgBox (0,"", "Fehler Zeitangabe Sa")
Return
EndIf
If RegRead ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay") <> "" Then RegDelete ("HKLM\Software\MaxTime\" & $username & "\Restricted", "AllDay")
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "2", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z5) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z6) & ";" & GUICtrlRead ($hinput_Mo))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "3", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z3) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z4) & ";" & GUICtrlRead ($hinput_Di))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "4", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z7) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z8) & ";" & GUICtrlRead ($hinput_Mi))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "5", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z9) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z10) & ";" & GUICtrlRead ($hinput_Do))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "6", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z11) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z12) & ";" & GUICtrlRead ($hinput_Fr))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "7", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z13) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z14) & ";" & GUICtrlRead ($hinput_Sa))
RegWrite ("HKLM\Software\MaxTime\" & $username & "\Restricted", "1", "REG_SZ", _
_GUICtrlComboBox_GetEditText ($Combo_z15) & ";" & _GUICtrlComboBox_GetEditText ($Combo_z16) & ";" & GUICtrlRead ($hinput_So))
EndIf
_setlogintime ()
EndFunc
;Befülle Array mit den Anmeldezeiten
Func _fillarray ()
Local $y = 0
For $j = 0 to 23
For $x = 0 To 45 Step 15
If $j < 10 Then
If $x > 0 Then
$hourrecords [$y] = "0" & $j & ":" & $x
$y += 1
Else
$hourrecords [$y] = "0" & $j & ":" & "0" & $x
$y += 1
EndIf
Else
If $x > 0 Then
$hourrecords [$y] = $j & ":" & $x
$y += 1
Else
$hourrecords [$y] = $j & ":" & "0" & $x
$y += 1
EndIf
EndIf
Next
Next
$hourrecords [$y] = "keine"
EndFunc
Func _checkCombo_z ($handle, $handle1)
If _GUICtrlComboBox_GetEditText ($handle) = "keine" Then _GUICtrlComboBox_SetCurSel ($handle1, _GUICtrlComboBox_FindString ($handle1, "keine"))
EndFunc -
@-1 Gutes Programm
Welches MiniProgramm soll ich machen hab lieder nicht viel zeit da her ein miniprogramm???
-