Bunny_Ding Posted January 5, 2016 Posted January 5, 2016 Hi All, Sorry I may ask this silly question. I am doing some project now, here is a GUI just created. Simply saying is I wish to do once the certain checkbox has been checked and click the Run Test botton. It should run the respective function test. The individual functions I have created already.Please help~~~ Thanks a lot!
InunoTaishou Posted January 5, 2016 Posted January 5, 2016 Use GUICtrlRead to get the state of the checkbox and execute the respective function is they are checkedexpandcollapse popup#include <GUIConstants.au3> Global $frmMain = GUICreate("Test", 300, 200) Global $inpInput = GUICtrlCreateInput("", 10, 10, 280, 20) Global $chkMsgBox = GUICtrlCreateCheckbox("MsgBox('', '', 'Inputbox')", 10, 35, 280) Global $chkShellExecute = GUICtrlCreateCheckbox("ShellExecute('Inputbox')", 10, 55, 280) Global $btnRun = GUICtrlCreateButton("Run Test", 10, 80, 280, 20) Global $bExecuteMsgBox = False Global $bExecuteShell = False GUISetState(@SW_SHOW, $frmMain) ; Option 1 While (1) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE Exit Case $btnRun Local $sData = GUICtrlRead($inpInput) If ($bExecuteShell) Then ShellExecute($sData) If ($bExecuteMsgBox) Then MsgBox("", "", $sData) Case $chkMsgBox $bExecuteMsgBox = Not $bExecuteMsgBox Case $bExecuteShell $bExecuteShell = Not $bExecuteShell EndSwitch WEnd ; Option 2 While (1) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE Exit Case $btnRun Local $sData = GUICtrlRead($inpInput) If (GUICtrlRead($chkShellExecute) = $GUI_CHECKED) Then ShellExecute($sData) If (GUICtrlRead($chkMsgBox) = $GUI_CHECKED) Then MsgBox("", "", $sData) EndSwitch WEnd GoogleGonnaSaveUs 1
Bunny_Ding Posted January 6, 2016 Author Posted January 6, 2016 Hi InunoTaishou, Thanks a lot for your help. It is really Great.Besides this, may i ask another question is about the global variables. For example: The passwrod input box is allowing me to input some data and store it. when I wish to run any of the test, inside the function it will request the password as I key inside the input box. So that I just change the data by the input box, then it can work for other scripting as I created. I have been tried a few times, but it not really work. So glad to get the helps from you! Thanks a lot!
careca Posted January 6, 2016 Posted January 6, 2016 Im honest, didn't get the question, but i know it's something about a password input. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
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