Hallo.
Ich habe eine listbox erstellt, die aus dem Scriptpfad die darin befindlichen Ordner [_aa], [_bb] ..., usw. auflistet.
Ich möchte nun einen der Ordner markieren und diesen dann an ein selbsterstelltes Programm als Startparameter übergeben.
aber das klappt leider irgendwie nicht.
Vielleicht ist jemand von Euch so freundlich, mir das zu erklären oder hält sogar die Lösung parat. Danke im Voraus.
-----SCRIPTSTART-----
#NoTrayIcon
#RequireAdmin
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <MsgBoxConstants.au3>
Local $meinprogramm = GUICreate("meinprogramm",250,200,-1,-1,-1,-1)
paramid()
Func paramid()
Local $idListBox
; Create GUI
$idListBox = GUICtrlCreatelist("",15,15,215,120,-1)
GUISetState(@SW_SHOW)
; Add files
_GUICtrlListBox_BeginUpdate($idListBox)
_GUICtrlListBox_ResetContent($idListBox)
_GUICtrlListBox_InitStorage($idListBox, 100, 4096)
_GUICtrlListBox_Dir($idListBox, @ScriptDir & "\_*", $DDL_DIRECTORY)
_GUICtrlListBox_EndUpdate($idListBox)
_GUICtrlListBox_SetCurSel($idListBox, 1)
EndFunc ;==>Modlist
$button1=GUICtrlCreateButton("Starten",75,150,100,30,-1,-1)
GUICtrlSetTip(-1,"Mit dem gewählten Ordner starten")
GUISetState(@SW_SHOW,$meinprogramm)
While 1
$nMsg = GuiGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button1
If ProcessExists ("meinprogramm.exe") Then ; Check if the process is running.
ProcessClose("meinprogramm.exe")
Run(@ScriptDir & '\meinprogramm.exe ' & _GUICtrlListBox_GetCurSel($idListBox))
Else
MsgBox($MB_SYSTEMMODAL, "", "meinprogramm wurde nicht gestartet.")
EndIf
EndSwitch
WEnd
-----SCRIPTENDE-----