Jump to content

[Newbie here] Can you point me in the right direction to figure out something really basic re starting single or multiple programs with one SUBMIT?


vidim
 Share

Recommended Posts

Hi all.

Basically I am a total beginner at this. I know a fair bit of HTML, CSS, iMacros, and I can probably meddle with other people's PHP.

I have just begun to learn this thing, cause I want something with a GUI, that can help me launch many different iMacros instances. The regular way of doing this in iMacros, with a batch file, just don't cut it for me.

I have downloaded Koda Form Designer cause it is WYSIWYG and it is supposed to integrate with AutoIT.

What I want to do; I have a GUI with many different check boxes and one SUBMIT button. I want each checkbox to have an EXE (or BAT) assigned, and have all those EXEs checked with the check box to start simultaneously when I click the submit.

For the sake of this discussion, let us pretend that these are the EXEs;

Run("one.exe")
Run("two.exe")
Run("three.exe")

And this is the GUI design as it comes from the Koda Form Designer

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 1217, 443, 198, 219)
$Checkbox1 = GUICtrlCreateCheckbox("ONE", 8, 64, 49, 33)
$Checkbox2 = GUICtrlCreateCheckbox("TWO", 8, 88, 41, 25)
$Checkbox3 = GUICtrlCreateCheckbox("THREE", 8, 112, 49, 17)
$Button1 = GUICtrlCreateButton("SUBMIT", 16, 192, 169, 57, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

So how do I link a certain EXE to a certain checkbox and have one of them, or all of them, start at the click of SUBMIT?

Thank you for reading this. Please note that if you decide to answer, and don't dumb the answer down, I might not get it.

Edited by vidim
Link to comment
Share on other sites

Welcome to AutoIt!

You were close :-)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 1217, 443, 198, 219)
$Checkbox1 = GUICtrlCreateCheckbox("ONE", 8, 64, 49, 25)
$Checkbox2 = GUICtrlCreateCheckbox("TWO", 8, 88, 49, 25)
$Checkbox3 = GUICtrlCreateCheckbox("THREE", 8, 112, 49, 25)
$Button1 = GUICtrlCreateButton("SUBMIT", 16, 192, 169, 57, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            If IsChecked($Checkbox1) Then MsgBox(0,'Run','1') ; Run("one.exe")
            If IsChecked($Checkbox2) Then MsgBox(0,'Run','2') ; Run("two.exe")
            If IsChecked($Checkbox3) Then MsgBox(0,'Run','3') ; Run("three.exe")
    EndSwitch
WEnd

Func IsChecked($control)
    Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc
Link to comment
Share on other sites

Thanks Zedna.

That only gives me a MSGBOX popping up, even with the default notepad.exe as chose exe.

I do appreciate you taking me this far though. I am sure I can work it out from here, now that you gave me the starting blocks. I'll be trying it out when I wake up.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...