Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Getting all text from childwindows through EnumChildWindows

Posted on 2008-06-16
9
Medium Priority
?
1,813 Views
Last Modified: 2012-05-05
Hi. (I AM USING VB.net, visual Studio 2005)
I need to extract the text on buttons, on labels, in textboxes etc inside another window ( in my case its from a provider och financialdata, where i want to read numbers ) . How can i locate ALL childwindows inside the other application and extract that text. I have tried with making something out of a combination of  
Declare Auto Function FindWindowEx Lib  "user32"
and
 Declare Function EnumChildWindows Lib "user32"
Basically I wan't ALL childwindows inside the MAIN Application.

Some info is here, but i don't exactly understand it.
http://www.xtremevbtalk.com/archive/index.php/t-130418.html

Say for example that i have the hWnd of the main window, and i wan't EVERYTHING that is a childwindow of hWnd, and also the "childwindows of the childwindow"
Thanks.

0
Comment
Question by:soriega
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 

Author Comment

by:soriega
ID: 21801113
Urgent help needed.. (Thanks)
0
 
LVL 10

Expert Comment

by:Clif
ID: 21804548
Not entirely sure of this will help, but I did find this which seems to fit what you're looking for...

http://forums.devshed.com/net-development-87/vb-net-getting-url-from-ie-instances-390854.html
0
 

Author Comment

by:soriega
ID: 21807128
Thanks, i will do some testing and se if it works
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:soriega
ID: 21807942
As far as i Can see, this solution ( in the link ) returns only the title of windows. In the example it returns the title of each Iexplorer window. What i was looking for was rather ALL the childwindows that are UNDER the main window. For example. If i have a Form1 with a button, named "button1"  and text button1.text="HELP" and a label with label1.text ="MYTEST", then what i want is a script that looks through Form1 and returns all the controls and labels, and the text of the childcontrols
Thanks
0
 
LVL 10

Expert Comment

by:Clif
ID: 21811929
To get the "text" of controls, you should use "getWindowText()".  You won't be able to get the values from labels, though.  Labels are not controls in the strictest sense of the word.
0
 

Author Comment

by:soriega
ID: 21811967
OK, is there any way of reading values from say a datagrid in another application. I basically wan't to read numbers and try to execute trades at an application from a online broker. It seems like its some sort of datagridview or labels or textboxes or similar
0
 
LVL 10

Accepted Solution

by:
Clif earned 1500 total points
ID: 21812032
Sorry, I can't help you there.  I really have no idea how a grid control is created or maintained (internally).

If the control has true windows (ie, has an hWnd), then you should be able to read the control's text.  Unfortunately not everything in Windows is a window, and not every text you see it a text object.  Some of the text you see is, for lack of a better term, images on the control.  This is what a label control basically is.  It's actually an image of the text and not the text itself (once the application is running).
0
 

Author Closing Comment

by:soriega
ID: 31467812
Thanks for the explanation, i was prepared that it might not work. I will try to find some better (...more expensive) provider of stockprices
0
 
LVL 10

Expert Comment

by:Clif
ID: 21812350
Will your application have web access?  If so, you can make an http call to get a page which contains the data you need and can easily scrape it from there.

Most websites have a fifteen to twenty minute delay on stock prices, though, unless you buy a subscription.

Good luck.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question