Hi, ich hätte da mal eine Frage. Und zwar programmier ich grade ein Programm (Script), das ein beliebiges Programm beendet, minimiert oder maximiert.
Mein Code:
Also Fehler enstehen keine (Syntaxfehler) aber es passiert einfach nix. Hab den Code mal an Solitär probiert, aber wenn ich M oder n drücke verkleinert noch vergrößert sich das fenster. Schließen kann ich es auch nicht. Woran liegt es?
mfg
Mein Code:
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Konfiguration", 447, 163, 192, 124)
GUISetBkColor(0xFFFFFF)
$Group1 = GUICtrlCreateGroup("HotKey", 160, 16, 281, 137)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Fenster minimieren - Nummernfeld Minus", 176, 96, 251, 20)
$Label2 = GUICtrlCreateLabel("Anwendung Beenden - Ende", 176, 72, 167, 20)
$Label3 = GUICtrlCreateLabel("Programm Beenden - Escape", 176, 48, 188, 20)
$Label4 = GUICtrlCreateLabel("Fenster maximieren - Nummernfeld Plus", 176, 120, 246, 20)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Programm Beenden", 8, 128, 123, 25, $WS_GROUP)
$Label5 = GUICtrlCreateLabel("Wie heißt das Programm?", 8, 24, 125, 17)
$Input1 = GUICtrlCreateInput("", 8, 48, 121, 21)
$Button2 = GUICtrlCreateButton("Speichern", 8, 80, 123, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
$read = INIRead ("C:\Settings.ini", "Main", "Value", "")
_GUICtrlEdit_SetText($Input1, $read)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Exit
Case $Button2
FileIniWrite()
EndSwitch
WEnd
$var = GUICtrlRead ($Input1)
Func FileIniWrite ()
$var = GUICtrlRead ($Input1)
IniWrite ("C:\Settings.ini", "Main", "Value", $var)
EndFunc
HotKeySet ("{ESC}", "Terminate")
HotKeySet ("{End}", "_CLOSE")
HotKeySet ("M", "MAx")
HotKeySet ("n", "Min")
Func Terminate ()
Exit 1
EndFunc
Func _CLOSE ()
WinKill ($var)
EndFunc
Func MAX ()
WinSetState ($var, "", @SW_SHOW)
EndFunc
Func Min ()
WinSetState ($var, "", @SW_HIDE)
EndFunc
mfg