c4mpi Posted March 22, 2010 Share Posted March 22, 2010 Hi, Im playing around with the checkbox utility and I want to make a simple "launcher" Here is what Ive come up with #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 233, 209, 192, 124) $Group1 = GUICtrlCreateGroup("Oppsett", 16, 16, 193, 161) $Checkbox1 = GUICtrlCreateCheckbox("1", 104, 48, 97, 17) $Checkbox2 = GUICtrlCreateCheckbox("2", 104, 72, 97, 17) $Checkbox3 = GUICtrlCreateCheckbox("3", 104, 96, 97, 17) $Checkbox4 = GUICtrlCreateCheckbox("4, 104, 120, 97, 17) $Button1 = GUICtrlCreateButton("OK", 104, 144, 75, 25, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $Checkbox1 > 1 Then Run("notepad.exe") EndSwitch WEnd But what this code does is start notepad on button click. I want it to check what checkboxes is checked and start notepad if checkbox1 is checked Link to comment Share on other sites More sharing options...
99ojo Posted March 22, 2010 Share Posted March 22, 2010 Hi, If GuiCTRLRead ($Checkbox1) = $GUI_CHECKED Then ;-)) Stefan Link to comment Share on other sites More sharing options...
somdcomputerguy Posted March 22, 2010 Share Posted March 22, 2010 (edited) Use If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then Run("notepad.exe")Edit: I'm a slow typer.. Another Edit: This'll work too,If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then Run("notepad.exe") Edited March 22, 2010 by snowmaker iFFgen 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
c4mpi Posted March 22, 2010 Author Share Posted March 22, 2010 thanks 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