[Autoit] Hilfe...komm nicht weiter

07/29/2012 02:17 Masterruffy#1
Also ich will/wollte ein kleines Programm erstellen womit ich Programme starten kann damit es ewas schneller ist als immer auf desktop und starmenü zu klicken(ich möchte auch nicht das mein Desktop voller Verknüpfungen sind^^)
also ich habe mit dem Befehl :
GUICtrlCreateCombo
gearbeitet und will nun wenn man etwas auwählt das das Programm startet ..aber ich bekomme das nicth so hin :o
Hier der kleine Code :
Code:
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$progs = GUICreate("Programme", 623, 442, 192, 124)
GUISetBkColor(0xC0C0C0)
$radiofx = GUICtrlCreateButton("radiofx", 40, 32, 65, 49, BitOR($BS_DEFPUSHBUTTON,$BS_PUSHBOX))

$start = GUICtrlCreateButton("start", 128, 32, 73, 49)

;liste
$List1 = GUICtrlCreateList("", 32, 136, 169, 240)
GUICtrlSetData(-1, "- RadioFx|- Free Moxilla FireFox|- Eingabeaufforderung|- CCleaner|- Speecy","")
;auswählen
$selection = GUICtrlCreateCombo("Programmliste", 304, 40, 193, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1,"- RadioFx|- Free Moxilla FireFox|- Eingabeaufforderung|- CCleaner|- Speecy","Programmliste")
;Funktionen
HotKeySet ("{esc}","Beenden")
Func Beenden()
   exit
   EndFunc
;disable button
GUICtrlSetState($radiofx, $GUI_DISABLE)
GUISetState(@SW_SHOW)


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $radiofx
			Run ("C:\Programme\Tobit Radio.fx\Client\rfx-client.exe")
			           ; GUICtrlSetState($radiofx, $GUI_ENABLE)


	EndSwitch
WEnd
Ich habs wuach iwie mit der Liste versucht (GUICtrlCreateList) aber das ist iwie dasselbe Problem..
-Ich bin Anfänger..
07/29/2012 15:23 omer36#2
z. b. so

PHP Code:
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

HotKeySet ("{esc}","Beenden")

$progs GUICreate("Programme"623442192124)
GUISetBkColor(0xC0C0C0)
$radiofx GUICtrlCreateButton("radiofx"40326549BitOR($BS_DEFPUSHBUTTON,$BS_PUSHBOX))
$start GUICtrlCreateButton("start"128327349)
;
liste
$List1 
GUICtrlCreateList(""32136169240)
GUICtrlSetData(-1"- RadioFx|- Free Moxilla FireFox|- Eingabeaufforderung|- CCleaner|- Speecy","")
;
auswählen
$selection 
GUICtrlCreateCombo("Programmliste"3044019325BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1,"- RadioFx|- Free Moxilla FireFox|- Eingabeaufforderung|- CCleaner|- Speecy","Programmliste")
;
disable button
GUICtrlSetState
($radiofx$GUI_DISABLE)
GUISetState(@SW_SHOW)


While 
1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$start
            $ComboRead 
GUICtrlRead($selection)
            Switch 
$ComboRead
                
Case "- RadioFx"
                    
ShellExecute( .... )
                Case 
"- Free Moxilla FireFox"
                    
ShellExecute( .... )
                Case 
"- Eingabeaufforderung"
                    
ShellExecute( .... )


            EndSwitch
    EndSwitch
WEnd

Func Beenden
()
   exit
EndFunc 
07/29/2012 16:36 Masterruffy#3
Also erst mal für die Antwort :D
also ich wollte eigentlich ohne den "start-button" öich habs mit dem versucht darum hab ich es dort eingefügt und du hast mir auch die lösung gezeigt danke :o
Aber eigentlich wollte ich wenn man etwas von der Liste auswählt dann auch sofort startet ohne auf den startbutton zudrück ^^ funktiioniert das?

Edit : habs selber rausgefunden ..auch wenns vllt nicht ganz richtig ist : man muss anstatt
PHP Code:
Case $start
            $ComboRead 
GUICtrlRead($selection)
            Switch 
$ComboRead
                
Case "- RadioFx"
                    
ShellExecute("C:\Programme\Tobit Radio.fx\Client\rfx-client.exe"
nur "Case" ändern als direkt auf der combo
PHP Code:
Case $selection
            $ComboRead 
GUICtrlRead($selection)
            Switch 
$ComboRead
                
Case "- RadioFx"
                    
ShellExecute("C:\Programme\Tobit Radio.fx\Client\rfx-client.exe"