Using GetListItem for a ListBox inside an IE Browser Window

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Using GetListItem for a ListBox inside an IE Browser Window

Post by jpuziano » Sat Mar 11, 2006 11:01 pm

Hi Support,

I am trying to use the GetListItem command with a ListBox control on a webpage (IE browser window). There are two ListBox controls on the webpage with about 150 values in each. I am trying to use GetListItem to determine if a particular choice is there and if so, what the offset is so I can send the keystrokes to choose it... just like your example does in the help file documentation for GetListItem.

Code: Select all

The Macro Scheduler "View System Windows" tool produced these lines showing the main IE window and the two List Box controls (other lines not shown)

3408450 - IEFrame "Sys1 - Microsoft Internet Explorer."
984040 - Internet Explorer_TridentLstBox ""
1770250 - Internet Explorer_TridentLstBox ""
I used "Internet Explorer_TridentLstBox" for the Class Name like this...

GetListItem>Sys1 - Microsoft Internet Explorer.,Internet Explorer_TridentLstBox,1,Item,0,0,0,nDx,lvHwnd

Running the above line causes Macro Scheduler to lockup so that it must be closed via the Task Manager.

I know this is the right object due to the following...

Code: Select all

Let>lbhandle=1770250
LibFunc>user32,GetListBoxInfo,resultvar,lbhandle
MDL>resultvar
//THIS WORKED, it returned 158 and there are 158 items in the List Box
I also tried another utility to view the System Windows called WinExplorer. It shows more of the hierarchy, which object is under which object:

Code: Select all

- Sys1 - Microsoft Internet Explorer. [IEFrame]
  - [Shell DocObject View]
    - [Internet Explorer_Server]
      - [Internet Explorer_TridentLstB]
      - [Internet Explorer_TridentLstB]
Is the Internet Explorer_Server object getting in the way?
Can GetListItem be used with a List Box displayed inside an IE browser window?
How can I get at the items in this List box?

:? Any help would be much appreciated... :?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Mar 12, 2006 6:07 am

Can you View Source of the web page and Search for the values in Option value section?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sun Mar 12, 2006 11:49 pm

Hi Bob,

Thanks for the suggestion, I didn't think of that... but no, view source isn't much help, not many lines there and no List Box values.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts