Button Problem

01/14/2012 20:55 0Slashking0#1
Also ich versuche schon seit Stunden ein Programm zu schreiben, dass einfach nur den Anwendungsdateien Ordner auf Knopfdruck öffnet! Problem: @appdatadir funzt net! der sagt immer da wär n Syntax error! Help!:confused::confused::confused:
Hier der Code:


#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Users\Internet Alex\Desktop\Scripten\Koda\Forms\Form1.kxf
$Form1 = GUICreate("Form1", 625, 342, 193, 125)
$Button1 = GUICtrlCreateButton("Start now!", 0, 288, 619, 49, 0)
$Label1 = GUICtrlCreateLabel("text", 64, 72, 463, 17)
$Label2 = GUICtrlCreateLabel("text", 64, 96, 419, 17)
$Label3 = GUICtrlCreateLabel("text", 64, 120, 234, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $Button1
@AppDataDir HIER LIEGT DAS PROBLEM!!!!!

EndSwitch
WEnd
01/14/2012 21:06 xShizoidx#2
Wie soll er denn auch den Ordner öffnen, wenn du keinen Befehl angibst?
Naja, mit Shellexecute kannst du auch einen Ordner öffnen.

Hier mal der Code :
Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Users\Internet Alex\Desktop\Scripten\Koda\Forms\Form1.kxf
$Form1 = GUICreate("Form1", 625, 342, 193, 125)
$Button1 = GUICtrlCreateButton("Start now!", 0, 288, 619, 49, 0)
$Label1 = GUICtrlCreateLabel("text", 64, 72, 463, 17)
$Label2 = GUICtrlCreateLabel("text", 64, 96, 419, 17)
$Label3 = GUICtrlCreateLabel("text", 64, 120, 234, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $Button1
ShellExecute(@AppDataDir)

EndSwitch
WEnd
Falls du noch irgendwelche Fragen hast, kannst du mich auch bei Skype adden und ich helfe dir soweit ich kann.
01/14/2012 21:08 Njahs#3
Code:
#include <GUIConstantsEx.au3>

#Region ### START Koda GUI section ### Form=C:\Users\Internet Alex\Desktop\Scripten\Koda\Forms\Form1.kxf
$Form1 = GUICreate("Form1", 625, 342, 193, 125)
$Button1 = GUICtrlCreateButton("Start now!", 0, 288, 619, 49, 0)
$Label1 = GUICtrlCreateLabel("text", 64, 72, 463, 17)
$Label2 = GUICtrlCreateLabel("text", 64, 96, 419, 17)
$Label3 = GUICtrlCreateLabel("text", 64, 120, 234, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
       Case $GUI_EVENT_CLOSE
           Exit

       Case $Button1
           FileOpen(@AppDataDir)

      EndSwitch
WEnd
01/14/2012 21:14 0Slashking0#4
Danke, danke und nochmals danke!:handsdown:
Achja :closed oder wie auch immer man das schreibt!
01/14/2012 21:23 xShizoidx#5
Quote:
Originally Posted by Njahs View Post
Code:
#include <GUIConstantsEx.au3>

#Region ### START Koda GUI section ### Form=C:\Users\Internet Alex\Desktop\Scripten\Koda\Forms\Form1.kxf
$Form1 = GUICreate("Form1", 625, 342, 193, 125)
$Button1 = GUICtrlCreateButton("Start now!", 0, 288, 619, 49, 0)
$Label1 = GUICtrlCreateLabel("text", 64, 72, 463, 17)
$Label2 = GUICtrlCreateLabel("text", 64, 96, 419, 17)
$Label3 = GUICtrlCreateLabel("text", 64, 120, 234, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
       Case $GUI_EVENT_CLOSE
           Exit

       Case $Button1
           FileOpen(@AppDataDir)

      EndSwitch
WEnd
Mit Fileopen können keine Ordner geöffnet werden, nur Dateien.