Greenroom Posted April 17, 2009 Share Posted April 17, 2009 Hello everyone, (my first Post, sorry if i made some misstakes :/) So here is my little script: #include <GUIConstants.au3> #include <ComboConstants.au3> $Form1 = GUICreate("", 100, 150, 193, 125) $Button1 = GUICtrlCreateButton("Run It!", 12, 4, 75, 25, 0) $List1 = GUICtrlCreateList("", 12, 88, 75, 60,0) GUICtrlSetData(-1, "Prog1|Prog2") GUISetState(@SW_SHOW) While 1 Global $cits=0 Local $msg=GuiGetMsg() Select Case $msg=$Gui_Event_Close GuiSetState(@sw_hide) Case $msg=GuiCtrlRead("Prog1") MsgBox(1,"Prog1",$cits,0) Case $msg=GuiCtrlRead("Prog2") MsgBox(2,"Prog2",$cits,0) EndSelect WEnd (found something with the forum search, something in the docs, and some from Kodu ) Sadly it doesnt work so good (I want to make a launcher for some Programs). I think the misstake is in the loop, because the script Spam a lot of windows (Prog1) Please help, and sorry for bad english Link to comment Share on other sites More sharing options...
Greenroom Posted April 17, 2009 Author Share Posted April 17, 2009 Hello everyone, (my first Post, sorry if i made some misstakes :/)So here is my little script:#include <GUIConstants.au3> #include <ComboConstants.au3> $Form1 = GUICreate("", 100, 150, 193, 125) $Button1 = GUICtrlCreateButton("Run It!", 12, 4, 75, 25, 0) $List1 = GUICtrlCreateList("", 12, 88, 75, 60,0) GUICtrlSetData(-1, "Prog1|Prog2") GUISetState(@SW_SHOW) While 1 Global $cits=0 Local $msg=GuiGetMsg() Select Case $msg=$Gui_Event_Close GuiSetState(@sw_hide) Case $msg=GuiCtrlRead("Prog1") MsgBox(1,"Prog1",$cits,0) Case $msg=GuiCtrlRead("Prog2") MsgBox(2,"Prog2",$cits,0) EndSelect WEnd(found something with the forum search, something in the docs, and some from Kodu )Sadly it doesnt work so good (I want to make a launcher for some Programs).I think the misstake is in the loop, because the script Spam a lot of windows (Prog1)Please help, and sorry for bad englishOkay Searched a while, and found something:#include <GUIConstants.au3> #include <ComboConstants.au3> Opt('MustDeclareVars', 1) LAUNCHER() Func LAUNCHER() Local $n1, $n2, $msg, $menustate, $menutext GUICreate("LAUNCHER") $n1 = GUICtrlCreateList("", 10, 10, -1, 100) GUICtrlSetData(-1, "item1|item2|item3", "item2") $n2 = GUICtrlCreateButton("Read", 10, 110, 50) GUISetState() Do $msg = GUIGetMsg() If $msg = $n2 Then MsgBox(0, "Selected listbox entry", GUICtrlRead($n1)) EndIf Until $msg = $GUI_EVENT_CLOSE EndFuncthis works perfectly! thanks for anyone who would help! (sry couldnt edit the old post ?!?!) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now