Hallo Leute,
Ich habe eine Frage zu AutoIT:
Wie ist der Befehl um das obere Fenster zu schließen?
Danke im vorraus... ![]()
MfG Mateo
Hallo Leute,
Ich habe eine Frage zu AutoIT:
Wie ist der Befehl um das obere Fenster zu schließen?
Danke im vorraus... ![]()
MfG Mateo
Wingettitle("")
in Kombination mit Winkill
Ich bin noch nicht so der Profi...
Habe hier mal mein Beispiel:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 116, 78, 673, 309)
$Button1 = GUICtrlCreateButton("Button1", 8, 8, 99, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Button2", 8, 40, 99, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(292,"Test","Wirklich beenden?")
Select
Case $iMsgBoxAnswer = 6
Exit
Case $iMsgBoxAnswer = 7
; wenn ich jetzt hier auf nein klicke dann sollte sich nur das frage-fenster schließen, nicht aber das ganze programm. Mit Exit funktioniert das ja nicht ![]()
EndSelect
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]EndSwitch
WEnd
Kannst du mir das nochmal anhand von einem Quellcode zeigen?
MfG Mateo
Dein select Gedöns ist bei ganzen 2 Auswahlmöglichkeiten unsinn, zumal du für "Nein" garnichts tun musst, die msgbox verschwindet einfach wenn du "Nein" klickst und diesen Fall nicht abdeckst.
PS: Dein Script hatte doch so sogar funktioniert ![]()
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 116, 78, 673, 309)
$Button1 = GUICtrlCreateButton("Button1", 8, 8, 99, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Button2", 8, 40, 99, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer ; öhm ja brauchste eigtl nicht, aber meinetwegen
$iMsgBoxAnswer = MsgBox(292,"Test","Wirklich beenden?")
if $iMsgBoxAnswer = 6 then Exit
if $iMsgBoxAnswer = 7 then Sleep(10) ; brauchste auch garnicht diese Zeile, wollte dir nur die Möglichkeit lassen auch was sinnvolles zu tun...
EndSwitch
WEnd
Man bin ich blöd ![]()
Danke ![]()
Wenn die Frage gelöst ist stell doch bitte das Präfix auf [gelöst]. Das kannst du machen in dem du den ersten Beitrag bearbeitest und oben Präfix umstellst.
Jo alles klar ![]()