Die Buttons....

05/26/2010 11:52 Peter5754#1
Hallo e*pvp Coder
ich möchte in Autoit ein Programm schreiben das wenn ich einen Button drücke ein gewünschtes Programm geöffnet wird.
Hier mal mein vergeblicher Versuch....
Code:
while 1
Switch GUIGetMsg()

Case $Button1
Run ("C:\Programme\Mozilla Firefox\Firefox.exe")

EndSwitch 
WEnd
PS: Ich habe die Buttons schon mit Koda gemacht.


Peter
05/26/2010 19:38 omer36#2
wenn du es mit KODA machst, kommt das alles.

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"226182192124)
$Button1 GUICtrlCreateButton("Button1"324014581$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
    EndSwitch
WEnd 
dann addest du (wie du es schon gemacht hast)
PHP Code:
        Case $button1
            Run
("C:\Programme\Mozilla Firefox\firefox.exe")
            
WinWaitActive("Mozilla Firefox"
das dazu, dann hast du:
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"226182192124)
$Button1 GUICtrlCreateButton("Button1"324014581$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$button1
            Run
("C:\Programme\Mozilla Firefox\firefox.exe")
            
WinWaitActive("Mozilla Firefox")
    EndSwitch
WEnd 
MfG