PcExpert Posted January 18, 2006 Posted January 18, 2006 (edited) Hello, Does anyone know how to create a checkbox, like hitmanpro: you check a checkbox and then push a start button and the programs that are checked will start but unchecked programs will not start. Does anyone know how to do that? Thanks, PcExpert Edited January 18, 2006 by PcExpert
BigDod Posted January 18, 2006 Posted January 18, 2006 Hello,Does anyone know how to create a checkbox, like hitmanpro: you check a checkbox and then push a start button and the programs that are checked will start but unchecked programs will not start. Does anyone know how to do that?Thanks,PcExpertYou will need to use GUICtrlRead Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
MadBoy Posted January 18, 2006 Posted January 18, 2006 You will need to use GUICtrlReadPls tell more Maybe you could show me the path in other forum where i pasted the code My little company: Evotec (PL version: Evotec)
BigDod Posted January 18, 2006 Posted January 18, 2006 Pls tell more Maybe you could show me the path in other forum where i pasted the codeHere is a basic example I found on the GUI forum #include <GUIConstants.au3> GUICreate("") $CHECK = GUICtrlCreateCheckbox(" CHECKBOX", 10, 10, 120, 20) $DONE = GUICtrlCreateButton("done", 20, 40, 60, 25) GUISetState() While 1 $MSG = GUIGetMsg() $READ2 = GUICtrlRead($CHECK) If $MSG = $DONE Then If $READ2 = $GUI_CHECKED Then $II = MsgBox(262145, "", "checked") ElseIf $READ2 = $GUI_UNCHECKED Then $II = MsgBox(262145, "", "unchecked") EndIf EndIf If $MSG = $GUI_EVENT_CLOSE Then ExitLoop WEnd Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
PcExpert Posted January 22, 2006 Author Posted January 22, 2006 How can I add more checkboxes to check? Here is a basic example I found on the GUI forum #include <GUIConstants.au3> GUICreate("") $CHECK = GUICtrlCreateCheckbox(" CHECKBOX", 10, 10, 120, 20) $DONE = GUICtrlCreateButton("done", 20, 40, 60, 25) GUISetState() While 1 $MSG = GUIGetMsg() $READ2 = GUICtrlRead($CHECK) If $MSG = $DONE Then If $READ2 = $GUI_CHECKED Then $II = MsgBox(262145, "", "checked") ElseIf $READ2 = $GUI_UNCHECKED Then $II = MsgBox(262145, "", "unchecked") EndIf EndIf If $MSG = $GUI_EVENT_CLOSE Then ExitLoop WEnd
BigDod Posted January 22, 2006 Posted January 22, 2006 Not perfect but it is a start #include <GUIConstants.au3> GUICreate("") $CHECK = GUICtrlCreateCheckbox(" CHECKBOX", 10, 10, 120, 20) $CHECK1 = GUICtrlCreateCheckbox(" CHECKBOX1", 10, 30, 120, 20) $CHECK2 = GUICtrlCreateCheckbox(" CHECKBOX2", 10, 50, 120, 20) $CHECK3 = GUICtrlCreateCheckbox(" CHECKBOX3", 10, 70, 120, 20) $DONE = GUICtrlCreateButton("done", 150, 40, 60, 25) GUISetState() While 1 $MSG = GUIGetMsg() $READ2 = GUICtrlRead($CHECK) $READ3 = GUICtrlRead($CHECK1) $READ4 = GUICtrlRead($CHECK2) $READ5 = GUICtrlRead($CHECK3) If $MSG = $DONE Then If $READ2 = $GUI_CHECKED Then $II = MsgBox(262145, "", "Checkbox checked") ElseIf $READ3 = $GUI_CHECKED Then $II1 = MsgBox(262145, "", "Checkbox1 checked") ElseIf $READ4 = $GUI_CHECKED Then $II2 = MsgBox(262145, "", "Checkbox2 checked") ElseIf $READ5 = $GUI_CHECKED Then $II3 = MsgBox(262145, "", "Checkbox3 checked") EndIf EndIf If $MSG = $GUI_EVENT_CLOSE Then ExitLoop WEnd Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
PcExpert Posted January 22, 2006 Author Posted January 22, 2006 (edited) Thanks, but how can I let the second program wait till the first is finished? Because if I check CHECKBOX and CHECKBOX 2 then only CHECKBOX will show something. Not perfect but it is a start #include <GUIConstants.au3> GUICreate("") $CHECK = GUICtrlCreateCheckbox(" CHECKBOX", 10, 10, 120, 20) $CHECK1 = GUICtrlCreateCheckbox(" CHECKBOX1", 10, 30, 120, 20) $CHECK2 = GUICtrlCreateCheckbox(" CHECKBOX2", 10, 50, 120, 20) $CHECK3 = GUICtrlCreateCheckbox(" CHECKBOX3", 10, 70, 120, 20) $DONE = GUICtrlCreateButton("done", 150, 40, 60, 25) GUISetState() While 1 $MSG = GUIGetMsg() $READ2 = GUICtrlRead($CHECK) $READ3 = GUICtrlRead($CHECK1) $READ4 = GUICtrlRead($CHECK2) $READ5 = GUICtrlRead($CHECK3) If $MSG = $DONE Then If $READ2 = $GUI_CHECKED Then $II = MsgBox(262145, "", "Checkbox checked") ElseIf $READ3 = $GUI_CHECKED Then $II1 = MsgBox(262145, "", "Checkbox1 checked") ElseIf $READ4 = $GUI_CHECKED Then $II2 = MsgBox(262145, "", "Checkbox2 checked") ElseIf $READ5 = $GUI_CHECKED Then $II3 = MsgBox(262145, "", "Checkbox3 checked") EndIf EndIf If $MSG = $GUI_EVENT_CLOSE Then ExitLoop WEnd Edited January 22, 2006 by PcExpert
Moderators SmOke_N Posted January 22, 2006 Moderators Posted January 22, 2006 Ok, 1. You really need to do some research. BigDod found these by doing just that.2. What is your main focus here? Do you want to read the checkboxes to see if they are checked?All you have here are MsgBox examples, absolutely no example of your own.If you want to read if each are checked, Don't use ElseIf just use If/EndIf. If you want to use Run() and Wait until one program has finished, use RunWait(). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
PcExpert Posted January 22, 2006 Author Posted January 22, 2006 (edited) I want to select some programs to run then click a button and the the first program starts, when the first program is finished the second starts. Where do I have to search for if I want to Find what BigDod has found Edited January 22, 2006 by PcExpert
Moderators SmOke_N Posted January 22, 2006 Moderators Posted January 22, 2006 (edited) By using the Search and typing in keywords your looking for and using the + between them.I already told you how to do this really:If GUICtrlRead($Box1) = 1 Then RunWait('Some.exe') If Not ProcessExists('Some.exe') And GUICtrlRead($Box2) = 1 Then RunWait('SomeOther.exe') Edited January 22, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
PcExpert Posted January 22, 2006 Author Posted January 22, 2006 (edited) Where must I place it in this code? CODE: #include <GUIConstants.au3> GUICreate("") $CHECK = GUICtrlCreateCheckbox(" CHECKBOX", 10, 10, 120, 20) $CHECK1 = GUICtrlCreateCheckbox(" CHECKBOX1", 10, 30, 120, 20) $CHECK2 = GUICtrlCreateCheckbox(" CHECKBOX2", 10, 50, 120, 20) $CHECK3 = GUICtrlCreateCheckbox(" CHECKBOX3", 10, 70, 120, 20) $DONE = GUICtrlCreateButton("done", 150, 40, 60, 25) GUISetState() While 1 $MSG = GUIGetMsg() $READ2 = GUICtrlRead($CHECK) $READ3 = GUICtrlRead($CHECK1) $READ4 = GUICtrlRead($CHECK2) $READ5 = GUICtrlRead($CHECK3) If $MSG = $DONE Then If $READ2 = $GUI_CHECKED Then $II = MsgBox(262145, "", "Checkbox checked") ElseIf $READ3 = $GUI_CHECKED Then $II1 = MsgBox(262145, "", "Checkbox1 checked") ElseIf $READ4 = $GUI_CHECKED Then $II2 = MsgBox(262145, "", "Checkbox2 checked") ElseIf $READ5 = $GUI_CHECKED Then $II3 = MsgBox(262145, "", "Checkbox3 checked") EndIf EndIf If $MSG = $GUI_EVENT_CLOSE Then ExitLoop WEnd Edited January 22, 2006 by PcExpert
Moderators SmOke_N Posted January 22, 2006 Moderators Posted January 22, 2006 I already answered this... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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