Jump to content

I need help with GUICreateButton


Recommended Posts

I created a GUI with combobox and button

In the combobox I have 6 values

Now I want to everytime the form starts, the GUI let me choose 1 of 6 values then when i press the button, I will send keys to another windows (my case is chrome or firefox)

Here is the code that I have for now.

Group ()
Func Group()
GUICreate("iSwitch",200,100,700,200)
GUICtrlCreateLabel("Please choose:", 10, 10, 100, 20)
GUICtrlCreateCombo("BUDGET", 50, 30, 100,90)
GUICtrlSetData(-1, "MTI|NEW PHONE|TERRACOM|TSB|YOURTEL")
GUICtrlCreateButton("Switch", 50, 60, 100, 25)
GUISetState()
Sleep(1000); Allow 1 second to see the GUI.
EndFunc
Link to comment
Share on other sites

Lets see if i get it, you want to choose one option from the drop down list, and then when you press the button "Switch" to happen.. what?

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

Link to comment
Share on other sites

Just when I press Switch it will do the series of thing that I want (basically just perform alt+tab to switch to the next windows, then send mouse click at a point to activate the input box, then send the keys I want)

for example: when i choose "MTI" from the combobox, it will switch to the next windows and Send("MTI") to an input box.

Thanks

Link to comment
Share on other sites

Maybe some of this:

#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>
Opt("MustDeclareVars", 1);enabled
Global $hGUI, $Msg, $bSwitch, $cBUDGET;declare global variables
$hGUI = GUICreate("iSwitch", 200, 100, 700, 200)
GUICtrlCreateLabel("Please choose:", 10, 10, 100, 20)
$cBUDGET = GUICtrlCreateCombo("", 50, 30, 100, 90);<<<<<removed BUDGET or would be a value in drop down list
GUICtrlSetData(-1, "MTI|NEW PHONE|TERRACOM|TSB|YOURTEL","MTI")
;##====================================================^========sets default value
$bSwitch = GUICtrlCreateButton("Switch", 50, 60, 100, 25)
GUISetState()
While 1
$Msg = GUIGetMsg()
Switch $Msg
  Case $GUI_EVENT_CLOSE
   __MyExit()
   Exit
  Case $bSwitch; if $Msg = $bSwitch
   __SwitchFunc()
EndSwitch
WEnd
Func __SwitchFunc()
Local $crBUDGET
$crBUDGET = GUICtrlRead($cBUDGET)
If $crBUDGET = "MTI" Then MsgBox(0, "You Selected MTI", "ITem Index:  " & _GUICtrlComboBox_GetCurSel($cBUDGET))
;##======================^=========put code or call next Function here  ^==========retreives cursor index
If $crBUDGET = "NEW PHONE" Then
  MsgBox(0, "You Selected NEW PHONE", "ITem Index:  " & _GUICtrlComboBox_GetCurSel($cBUDGET))
  ;##========to do additional work, structure like this (If/EndIf)
EndIf
If _GUICtrlComboBox_GetCurSel($cBUDGET) = 2 Then MsgBox(0, "You Selected TERRACOM", "ITem Index:  " & _GUICtrlComboBox_GetCurSel($cBUDGET))
EndFunc   ;==>__SwitchFunc
Func __MyExit()
GUIDelete($hGUI)
Exit
EndFunc   ;==>__MyExit
Edited by SupaNewb
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...