Jump to content

control handle of combobox


vimala
 Share

Recommended Posts

hello sir/madam

I have tried with _guictrlcomboboxEx _* and _guictrlcombobox_* and these are not working with combobox.

further each time control handle keeps changing.which handle to be given in commands ie window or control handle?

I have even tried with control commands "select string" and this is not working.can u suggest some more commands to send values to combobox .

thanks a lot for your reply

Link to comment
Share on other sites

Some questions that come to my mind:

  • Do you create the combobox yourself or is it the combobox of another program?
  • What do you want to do with the combobox? Do you want to add new values to the combox?
  • Could you show the code you have so far?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Some questions that come to my mind:

  • Do you create the combobox yourself or is it the combobox of another program?
  • What do you want to do with the combobox? Do you want to add new values to the combox?
  • Could you show the code you have so far?
it is the combobox of .net application.

i need to automate by reading excel sheet values

the code here is

MouseMove(527,523)

MouseDown("left")

MouseUp("left")

$value12=$val12[$j]

$val12=_ExcelReadarray($oExcel,6,12,7,1,0)

_GUICtrlComboBox_SetCurSel(0x00010014,10)

Link to comment
Share on other sites

You could use AutoIt's Window Info Tool "Au3Info.exe" to get the ControlId of the Combobox and then ControlGetHandle to get the handle of the combobox.

Then you can use the _GUICtrlComboBox_* commands on that handle.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

_GUICtrlComboBox_SetCurSel(0x00010014,10)

You should get the handle with ControlGetHandle(), as water posted.

But if you should want to declare a literal handle (which will only work in the current instance of the GUI as handles change every time) use Hwnd():

$hCombo = Hwnd(0x00010014)
_GuiCtrlComboBox_SetCurSel($hCombo, 10)

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

hello sir

I have used all commands ie _guictrlcommands to send values to a combobox and also tried with handle .do we need to use opt() function?

combobox has 5 values starting with letter B(bangladesh,barbados,bahrain,...)

how to edit a combobox?

Link to comment
Share on other sites

Could you please post the code you have so far? That's the best way we can help you.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Moderators

.NET is a pain to automate. The best thing you can do is get the control information by it's client coordinates position on the applications GUI.

Once you get the controls position, _CtrlGetByPos or look at the _WinAPI_WindowFromPoint(), then you can start to manipulate with some _GUICtrlCombo* functions.

One thing I'll say is, in my experience, you do quite a bit of ControlSend/ControlClick/Control* functions rather than using the UDF functions, because there's always an underlying control to the control you're trying to manipulate it seems.

In addition, please refrain from typing in Caps, it's considered offensive to some, and it makes it hard to read for others.

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.

Link to comment
Share on other sites

hi there,

I try to get the data from a .NET listbox control, but ControlCommand(..."GetSelected", "") seem does not work, I got nothing.

I try to get the number o Item in the listbox.

@SmOke_N: we can not get information of .NET Listbox control? :D

so sad....

Posted Image

Link to comment
Share on other sites

  • Moderators

hi there,

I try to get the data from a .NET listbox control, but ControlCommand(..."GetSelected", "") seem does not work, I got nothing.

I try to get the number o Item in the listbox.

@SmOke_N: we can not get information of .NET Listbox control? :D

so sad....

Posted Image

WHOAH!!!

I never said you couldn't get the info of a .NET listbox ( in fact, that's simple! ).

You were talking ComboBox... whole different thing!

Glad you found a solution, but what I posted works too!

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.

Link to comment
Share on other sites

.NET is a pain to automate. The best thing you can do is get the control information by it's client coordinates position on the applications GUI.

Once you get the controls position, _CtrlGetByPos or look at the _WinAPI_WindowFromPoint(), then you can start to manipulate with some _GUICtrlCombo* functions.

One thing I'll say is, in my experience, you do quite a bit of ControlSend/ControlClick/Control* functions rather than using the UDF functions, because there's always an underlying control to the control you're trying to manipulate it seems.

In addition, please refrain from typing in Caps, it's considered offensive to some, and it makes it hard to read for others.

hello

I found out solution for combobox control.i followed as water replied.iused control get handle fn and _guictrlcombobox.

thank you

i feel sorry for using caps.

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...