|
You last visited: Today at 02:21
Advertisement
Problem mit Buttons
Discussion on Problem mit Buttons within the AutoIt forum part of the Coders Den category.
10/03/2010, 10:44
|
#1
|
elite*gold: 0
Join Date: Feb 2010
Posts: 413
Received Thanks: 36
|
Problem mit Buttons
Hey leute bin anfänger in autoit und möchte es so machen das wenn man auf den Button beenden klickt sich das fenster schließt aber irgendwie klappt das nicht so ganz hier einmal mein code:
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Start", 625, 443, 193, 125)
GUISetBkColor(0x3399FF)
$Button1 = GUICtrlCreateButton("Beenden", 0, 424, 81, 17, 0)
GUICtrlSetBkColor(-1, 0x800000)
$Button2 = GUICtrlCreateButton("Einloggen", 208, 160, 193, 97, 0)
GUICtrlSetBkColor(-1, 0x808000)
$Button3 = GUICtrlCreateButton("Homepage", 488, 0, 121, 33, 0)
GUICtrlSetBkColor(-1, 0x800080)
$Button4 = GUICtrlCreateButton("Account Erstellen", 0, 0, 161, 57, 0)
GUICtrlSetBkColor(-1, 0x008000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
EndSwitch
WEnd
If GuiGetMsg() = $Beenden then
Send ("!{F4}")
EndIf
Würde mich freuen wenn ihr mir helfen könntet..
|
|
|
10/03/2010, 10:53
|
#2
|
elite*gold: 52
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
|
So macht mans
PHP Code:
#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Start", 625, 443, 193, 125) GUISetBkColor(0x3399FF) $Button1 = GUICtrlCreateButton("Beenden", 0, 424, 81, 17, 0) GUICtrlSetBkColor(-1, 0x800000) $Button2 = GUICtrlCreateButton("Einloggen", 208, 160, 193, 97, 0) GUICtrlSetBkColor(-1, 0x808000) $Button3 = GUICtrlCreateButton("Homepage", 488, 0, 121, 33, 0) GUICtrlSetBkColor(-1, 0x800080) $Button4 = GUICtrlCreateButton("Account Erstellen", 0, 0, 161, 57, 0) GUICtrlSetBkColor(-1, 0x008000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE exit case $Button1 exit EndSwitch WEnd
|
|
|
10/03/2010, 11:04
|
#3
|
elite*gold: 0
Join Date: Feb 2010
Posts: 413
Received Thanks: 36
|
Danke und wenn ich dann die Homepage öffnen möchte wie mache ich das?
so?
While 2
$nMsg = GUIGetMsg()
Switch $nMsg
Run ("C:\Program Files\Mozilla Firefox\firefox")
WinWaitActive ("www.***.de")das ist glaub ich falsch
case $Button3
exit
EndSwitch
WEnd
exit
EndSwitch
WEnd
oder auch wieder ein Fehler?
Bitte um Hilfe
Gebe gerne Thanks
|
|
|
10/03/2010, 11:11
|
#4
|
elite*gold: 52
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
|
Ich habs immer mit Dos gemacht weil er da soweit ich weis deinen standard Browser nimmt.
PHP Code:
#include <Process.au3> #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Start", 625, 443, 193, 125) GUISetBkColor(0x3399FF) $Button1 = GUICtrlCreateButton("Beenden", 0, 424, 81, 17, 0) GUICtrlSetBkColor(-1, 0x800000) $Button2 = GUICtrlCreateButton("Einloggen", 208, 160, 193, 97, 0) GUICtrlSetBkColor(-1, 0x808000) $Button3 = GUICtrlCreateButton("Homepage", 488, 0, 121, 33, 0) GUICtrlSetBkColor(-1, 0x800080) $Button4 = GUICtrlCreateButton("Account Erstellen", 0, 0, 161, 57, 0) GUICtrlSetBkColor(-1, 0x008000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ###
While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE exit case $Button1 exit Case $Button3 _RunDos("start http://www.google.de/") EndSwitch WEnd
PS: Wenn du Etwas mit Buttons machst mach es immer in dem Prinzip weiter also erst Case und dann unten drunter was gemacht werden soll
|
|
|
10/03/2010, 11:19
|
#5
|
elite*gold: 0
Join Date: Feb 2010
Posts: 413
Received Thanks: 36
|
Irgendetwas muss falsch sein er zeigt mir jetzt Error: Unknown funktion name
|
|
|
10/03/2010, 11:22
|
#6
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,254
|
PHP Code:
#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Start", 625, 443, 193, 125) GUISetBkColor(0x3399FF) $Button1 = GUICtrlCreateButton("Beenden", 0, 424, 81, 17, 0) GUICtrlSetBkColor(-1, 0x800000) $Button2 = GUICtrlCreateButton("Einloggen", 208, 160, 193, 97, 0) GUICtrlSetBkColor(-1, 0x808000) $Button3 = GUICtrlCreateButton("Homepage", 488, 0, 121, 33, 0) GUICtrlSetBkColor(-1, 0x800080) $Button4 = GUICtrlCreateButton("Account Erstellen", 0, 0, 161, 57, 0) GUICtrlSetBkColor(-1, 0x008000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ###
While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE exit case $Button1 exit Case $Button3 ShellExecute("www.google.de") EndSwitch WEnd
wobei es mit _RunDos auch gehen müsste...
in welcher zeile ist den der error?
|
|
|
10/03/2010, 11:23
|
#7
|
elite*gold: 52
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
|
Du musst auch die #include <Process.au3> Includen wie ich es oben gemacht hab da der befehl in der Include deklariert wird.
|
|
|
10/03/2010, 11:26
|
#8
|
elite*gold: 0
Join Date: Feb 2010
Posts: 413
Received Thanks: 36
|
Danke danke klappt jetzt habt nen Thanks
|
|
|
10/03/2010, 19:48
|
#9
|
elite*gold: 0
Join Date: Feb 2010
Posts: 413
Received Thanks: 36
|
Eine Frage hätte ich da doch noch wie pausiere ich meinen script?
Also könntet ihr mir bitte den code hierzu schreiben das wäre echt super ;
Es muss zu Button 5
Gebe gerne Thanks wenns klappt
$Form1 = #include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
GUICreate("Start", 625, 443, 193, 125)
GUISetBkColor(0x3399FF)
$Button1 = GUICtrlCreateButton("Beenden", 0, 424, 81, 17, 0)
GUICtrlSetBkColor(-1, 0x800000)
$Button2 = GUICtrlCreateButton("Einloggen", 208, 160, 193, 97, 0)
GUICtrlSetBkColor(-1, 0x808000)
$Button3 = GUICtrlCreateButton("Unsere Homepage", 488, 0, 121, 33, 0)
GUICtrlSetBkColor(-1, 0x800080)
$Button4 = GUICtrlCreateButton("Account Erstellen", 0, 0, 161, 57, 0)
GUICtrlSetBkColor(-1, 0x008000)
$Button5 = GUICtrlCreateButton("Stop Bot", 560, 112, 65, 177, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
GUISetState(@SW_SHOW)
#EndRegion ### END K$oda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
exit
case $Button1
exit
Case $Button3
ShellExecute ("http://www.google.de/")
Case $Button4
ShellExecute ("http://www.google.de/")
EndSwitch
WEnd
|
|
|
10/03/2010, 19:55
|
#10
|
elite*gold: 52
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
|
Wenn du mir sagst, was pausiert werden soll kann ich dir gerne helfen
Ansonsten kann ich dir nur meine oft verwendete Pausefunktion ans Herz legen
PHP Code:
Global $paused $Form1 = #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= GUICreate("Start", 625, 443, 193, 125) GUISetBkColor(0x3399FF) $Button1 = GUICtrlCreateButton("Beenden", 0, 424, 81, 17, 0) GUICtrlSetBkColor(-1, 0x800000) $Button2 = GUICtrlCreateButton("Einloggen", 208, 160, 193, 97, 0) GUICtrlSetBkColor(-1, 0x808000) $Button3 = GUICtrlCreateButton("Unsere Homepage", 488, 0, 121, 33, 0) GUICtrlSetBkColor(-1, 0x800080) $Button4 = GUICtrlCreateButton("Account Erstellen", 0, 0, 161, 57, 0) GUICtrlSetBkColor(-1, 0x008000) $Button5 = GUICtrlCreateButton("Stop Bot", 560, 112, 65, 177, 0) GUICtrlSetBkColor(-1, 0xFFFF00) GUISetState(@SW_SHOW) #EndRegion ### END K$oda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE exit case $Button1 exit Case $Button3 ShellExecute ("http://www.google.de/") Case $Button4 ShellExecute ("http://www.google.de/") Case $Button5 $paused = Not $paused While $paused Sleep(50) EndSwitch WEnd
Allerdings funktioniert das wenn du eine while schleife oder sonstiges hast nurnoch mit hotkeys
|
|
|
10/03/2010, 20:17
|
#11
|
elite*gold: 0
Join Date: Feb 2010
Posts: 413
Received Thanks: 36
|
Einfach nur das der Script pausiert ist..meinte ich damit ..
Irgendwie klappt das mit deinem code nicht so ganz ...
No matching Switch steht dort
|
|
|
10/03/2010, 20:48
|
#12
|
elite*gold: 52
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
|
Ja habs WEnd vergessen so musses aussehen dasses klappt
PHP Code:
Global $paused #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= GUICreate("Start", 625, 443, 193, 125) GUISetBkColor(0x3399FF) $Button1 = GUICtrlCreateButton("Beenden", 0, 424, 81, 17, 0) GUICtrlSetBkColor(-1, 0x800000) $Button2 = GUICtrlCreateButton("Einloggen", 208, 160, 193, 97, 0) GUICtrlSetBkColor(-1, 0x808000) $Button3 = GUICtrlCreateButton("Unsere Homepage", 488, 0, 121, 33, 0) GUICtrlSetBkColor(-1, 0x800080) $Button4 = GUICtrlCreateButton("Account Erstellen", 0, 0, 161, 57, 0) GUICtrlSetBkColor(-1, 0x008000) $Button5 = GUICtrlCreateButton("Stop Bot", 560, 112, 65, 177, 0) GUICtrlSetBkColor(-1, 0xFFFF00) GUISetState(@SW_SHOW) #EndRegion ### END K$oda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE exit case $Button1 exit Case $Button3 ShellExecute ("http://www.google.de/") Case $Button4 ShellExecute ("http://www.google.de/") Case $Button5 $paused = Not $paused While $paused Sleep(50) wend EndSwitch WEnd
Trotzdem wüsste ich gerne was du pausieren willst das einzige was du da pausieren kannst is die Abfrage, ob ein Button gedrückt wurde.
|
|
|
10/04/2010, 15:39
|
#13
|
elite*gold: 0
Join Date: Feb 2010
Posts: 413
Received Thanks: 36
|
Geht es das man so pausiert das man nichts mehr klicken kann und dann halt noch nen Button macht wo es weiter geht?oder beides in einem?
|
|
|
10/04/2010, 15:49
|
#14
|
elite*gold: 52
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
|
Müsste dann so aussehen:
PHP Code:
Global $paused = 1 #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= GUICreate("Start", 625, 443, 193, 125) GUISetBkColor(0x3399FF) $Button1 = GUICtrlCreateButton("Beenden", 0, 424, 81, 17, 0) GUICtrlSetBkColor(-1, 0x800000) $Button2 = GUICtrlCreateButton("Einloggen", 208, 160, 193, 97, 0) GUICtrlSetBkColor(-1, 0x808000) $Button3 = GUICtrlCreateButton("Unsere Homepage", 488, 0, 121, 33, 0) GUICtrlSetBkColor(-1, 0x800080) $Button4 = GUICtrlCreateButton("Account Erstellen", 0, 0, 161, 57, 0) GUICtrlSetBkColor(-1, 0x008000) $Button5 = GUICtrlCreateButton("Stop Bot", 560, 112, 65, 177, 0) GUICtrlSetBkColor(-1, 0xFFFF00) GUISetState(@SW_SHOW) #EndRegion ### START Koda GUI section ### Form= While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Exit Case $Button3 ShellExecute("http://www.google.de/") Case $Button4 ShellExecute("http://www.google.de/") Case $Button5 If $paused = 1 Then GUICtrlSetState($Button1, $GUI_DISABLE) GUICtrlSetState($Button2, $GUI_DISABLE) GUICtrlSetState($Button3, $GUI_DISABLE) GUICtrlSetState($Button4, $GUI_DISABLE) $Paused -= 1 ElseIf $paused = 0 Then GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetState($Button2, $GUI_ENABLE) GUICtrlSetState($Button3, $GUI_ENABLE) GUICtrlSetState($Button4, $GUI_ENABLE) $Paused += 1 EndIf EndSwitch WEnd
|
|
|
10/04/2010, 16:04
|
#15
|
elite*gold: 0
Join Date: Feb 2010
Posts: 413
Received Thanks: 36
|
|
|
|
|
Similar Threads
|
Problem mit Buttons
04/06/2010 - AutoIt - 3 Replies
Hallo,
ich habe ein Problem mit den Buttons ich will das eine BMP Datei als Button angezeigt wird , diese wird zuerst in den Temp-Ordner kopiert .
Hier mein code:
$Button1 = GUICtrlCreateButton("", 16, 40, 75, 25, 0,$BS_BITMAP)
GUICtrlSetImage (-1,@Tempdir & "\Button1.bmp")
Aber es funktioniert nicht ,weis jemand warum?
|
[PROBLEM] Buttons nicht anklickbar!?
02/23/2010 - AutoIt - 7 Replies
Hey Leute hab mal wieder ne GUI erstellt mit Koda und da merk ich das ich die Buttons nicht anklicken kann!
Hab schon alles mögliche Versucht, mir wurde gesagt das es iwi an den Schichten liegen könnte aber die Buttons liegen ganz oben sonst könnte man sie ja nicht sehen ;)
Hoffe jemand weis da was,
Gruß,
Eddy²
P.S: Nicht nur die Buttons sind nicht anklickbar, sondern überhaupt alles!
€dit: Hat sich erledigt! Es lag an dem Hintergrundbild oO Hab einfach in dem Bereich wo die Buttons...
|
Problem wenn Buttons Disable dann Enable sind die buttons zum senden zu verwenden
11/19/2009 - AutoIt - 5 Replies
also hab ja durch hilfe geschafft buttons mit Checkbox Enable und disable zu machn nur mein prob ist jetzt das ich die buttons nicht verwenden kann hab schon einiges ausprobiert aber wenn ich dann bsp button1 drücke passiert einfach nix kann mir wer helfen `? bekommt thx für ;)
hier der code:
#include <GUIConstantsEx.au3>
GUICreate("")
$check = GUICtrlCreateCheckbox("Enable/Disable Buttons", 10, 10, 140, 20)
$button = GUICtrlCreateButton("Button",10,50)
$button1 =...
|
Problem mehrere Buttons auswählen
11/18/2009 - AutoIt - 5 Replies
Hi, ich wollte mir mal selber einen bot machen womit ich mehrere Sachen durch Buttonklick starten kann.
Soweit ist alles ok aber ein Problem gibts trotzdem:
Wenn ich einen Button anklicke wird das auch ausgeführt aber sobalt ich einen 2. dazu haben will funktioniert nur der 1. weiter. Das ist bei jedem Button so den ich dazu starten will.
Kann mir jemand da mal weiterhelfen?
Hier der Script:
#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3> ...
|
[Buttons]Hi wer kann mir die Buttons erklären
08/16/2009 - Metin2 Private Server - 6 Replies
Hi ich will kg machen,kenne aber die bedeutung der buttons nich könnt ihr mir vllt.helfen
MfG TheRisk
Hier ein Screen:http://img16.imageshack.us/img16/3016/gaul. jpg
|
All times are GMT +2. The time now is 02:21.
|
|