Hallo ihr schlauen User
Ich hab heute mein ersten "richtiges" Programm geschrieben, ich bitte darum um nachsicht
Es soll einen Prozess durch die .exe starten und zu einer bestimmten Zeit diesen auch wieder beenden.
Das hat soweit ja auch geklappt.
aber jetzt möchte ich (für meinen Vater) das Programm noch ein bischen vereinfach und zwar so:
1. Bis jetzt muss man den pfad zu der .exe per hand eingeben bzw. kopieren
----> Das würd ich gerne über eine "Ordnersuche" machen wie man es von Installationen kennt.
2. Würde ich es kerne so Einstellen, dass der Name vom Prozess selbstständig erkannt wird.
----> Sei es über eine direkte Funktion oder über eine Liste aller Prozesse
Mein Programm :)
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Pictures\lololol2.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("P-S&C", 268, 156, 258, 238)
$start=GUICtrlCreateInput("", 96, 8, 105, 21)
$stop=GUICtrlCreateInput("", 96, 40, 105, 21)
$pfad=GUICtrlCreateInput("", 96, 72, 105, 21)
$name=GUICtrlCreateInput("", 96, 104, 105, 21)
$Label1 = GUICtrlCreateLabel("Startzeit:", 8, 8, 45, 17)
$Label2 = GUICtrlCreateLabel("Stopzeit:", 8, 40, 45, 17)
$Label3 = GUICtrlCreateLabel("Dateipfad:", 8, 72, 53, 17)
$Label4 = GUICtrlCreateLabel("Prozessname:", 8, 104, 70, 17)
$Label5 = GUICtrlCreateLabel("(hh:mm)", 216, 8, 41, 17)
$Button1 = GUICtrlCreateButton("Start", 208, 128, 57, 25, 0)
GUICtrlSetBkColor(-1, 0xA6CAF0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
exit
Case $Label1
Case $Button1
_func1 ()
EndSwitch
WEnd
Func _func1 ()
$start2 = GUICtrlRead($start, 1)
$stop2 = GUICtrlRead($stop, 1)
$pfad2 = GUICtrlRead($pfad, 1)
$name2 = GUICtrlRead($name, 1)
GUIDelete()
while 1
$time=@Hour & ":" & @Min
select
case $time=$start2
Run ($pfad2)
sleep(90000)
case $time=$stop2
ProcessClose ($name2)
sleep(30000)
Case Else
sleep(30000)
EndSelect
WEnd
EndFunc
Ich freu mich über jeden Kommentar, jede Lösung und allem was mir dabei hilft mir selbst zu helfen
Und schonmal eun nettes Dankeschön vorab
Mfg
Zottel