Sign in to follow this  
Followers 0
vimala

control handle of combobox

17 posts in this topic

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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

iam getting error like "ERROR OCCURED WHILE WRITING TO EVENT LOG"

WOULD U HELP ME IN SOLVING THIS?

WILL BE A PROBLEM WITH COMBOBOX PROPERTY?

THANKS

Share this post


Link to post
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.


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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

oh, I found a topic has the same issue with me and he solve the problem already.

I should try to read help file first.

http://www.autoitscript.com/forum/index.php?showtopic=102128

Share this post


Link to post
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

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

I thank you for your help

vimala

Share this post


Link to post
Share on other sites

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

I thank you for your help i found out solution

vimala

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

i found out solution.i followed as u told by using control handle and guictrlcommands

thank you

vimala

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  
Followers 0