Jump to content
Sign in to follow this  
null0

GUICreate + SEND

Recommended Posts

Hey everyone, 

I am working on a GUI ComboBox that will execute various SEND commands when a $idComboBox is selected. 

What I have so far 

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
 
    Local $hGUI = GUICreate("Site 1", 300, 200)

    Local $idComboBox = GUICtrlCreateCombo("Site1", 10, 10, 185, 20)
    Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25)
    GUICtrlSetData($idComboBox, "Site 2|Site 3")

    GUISetState(@SW_SHOW, $hGUI)

    Local $sComboRead = ""

What function would I use that does something like

If selected Site 3

then

SEND("{UP}{DOWN{TAB}B{TAB}A{TAB}SELECT{TAB}START{TAB}{Enter}") 

 

Thank you for taking the time to read this. 

Share this post


Link to post
Share on other sites

@null0

If you are trying to automate a website, then take a look at _IE* functions in the Help file instead of send commands :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

Hello, 

@null0

When i do what you want to do. 

I manage that like this : 

First i read all control in a separate function so i dont pollute my initial code : 

Func ReadCategory ()
;~    Global $cCategory01 = GUICtrlRead ( $cCombo01 )
;     Global $cCategory001 = GUICtrlRead ( $cCombo001 )
      Global $cCategory0001 = GUICtrlRead ( $cCombo0001 )
;     Global $cCategory00001 = GUICtrlRead ( $cCombo00001 )
;     Global $cCategory000001 = GUICtrlRead ( $cCombo000001 )
;     Global $cCategory0000001 = GUICtrlRead ( $cCombo0000001 )

;     Global $cCategory02 = GUICtrlRead ( $cCombo03 )
;     Global $cCategory002 = GUICtrlRead ( $cCombo003 )
;     Global $cCategory0002 = GUICtrlRead ( $cCombo0003 )
;     Global $cCategory00002 = GUICtrlRead ( $cCombo00003 )
;     Global $cCategory000002 = GUICtrlRead ( $cCombo000003 )
;     Global $cCategory0000002 = GUICtrlRead ( $cCombo0000003 )

;=================================================================

;~    Global $cSubCategory01 = GUICtrlRead ( $cCombo02 )
;     Global $cSubCategory001 = GUICtrlRead ( $cCombo002 )
      Global $cSubCategory0001 = GUICtrlRead ( $cCombo0002 )
;     Global $cSubCategory00001 = GUICtrlRead ( $cCombo00002 )
;     Global $cSubCategory000001 = GUICtrlRead ( $cCombo000002 )
;     Global $cSubCategory0000001 = GUICtrlRead ( $cCombo0000002 )

;     Global $cSubCategory02 = GUICtrlRead ( $cCombo04 )
;     Global $cSubCategory002 = GUICtrlRead ( $cCombo004 )
;     Global $cSubCategory0002 = GUICtrlRead ( $cCombo0004 )
;     Global $cSubCategory00002 = GUICtrlRead ( $cCombo00004 )
;     Global $cSubCategory000002 = GUICtrlRead ( $cCombo000004 )
;     Global $cSubCategory0000002 = GUICtrlRead ( $cCombo0000004 )

;~ ===============================================================
      Global $cCombo0003Readed = GUICtrlRead ( $cCombo0003 )
EndFunc

After that i code my GUI:

Case $cCombo0001 ;Here I check if the Combo is selected by his VarID
         ReadCategory () ;Now i read the combot ( first function showed )
         If $cCategory0001 = "WhatIWant" Then ; If the combo is what i want then i do my stuff
            ...
            ...
            ...
         EndIf

 


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...