Getting a handle to the contents of a window's contents

Hi everyone,
What Windows API should I use if I wanted to access the contents of a
window's contents. For instance, if I were to open a file in Word, or
browse a site using Explorer, how would I parse the text that I am
viewing?

TIA

Paul

0
paul9477 (50)
9/11/2006 2:25:06 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
465 Views

Similar Articles

[PageSpeed] 54

> What Windows API should I use if I wanted to access the contents of a
> window's contents. For instance, if I were to open a file in Word, or
> browse a site using Explorer, how would I parse the text that I am
> viewing?
>

It all depends upon the control you want the contents from.
GetWindowText etc will work for some. Keep in mind though you are out
of process. If you are looking into Office/IE, you are better off using
the object model of the application (auotmation) to get to the
contents.

---
Ajay

0
ajaykalra (6842)
9/11/2006 2:36:18 PM
If you want the contents of an entire page this article might be useful to 
you:

http://www.codeguru.com/cpp/i-n/internet/generalinternet/article.php/c3411/

Tom

<paul@paullee.com> wrote in message 
news:1157984706.627176.177600@e3g2000cwe.googlegroups.com...
> Hi everyone,
> What Windows API should I use if I wanted to access the contents of a
> window's contents. For instance, if I were to open a file in Word, or
> browse a site using Explorer, how would I parse the text that I am
> viewing?
>
> TIA
>
> Paul
> 


0
tserface (3861)
9/11/2006 3:47:34 PM
This depends on the application.  For some apps, like Word and IE, I believe there are COM
interfaces that give you the contents of the window.  GetWindowText only works for some of
the more trivial controls.  But each app is going to be different as to what it supports
and how it supports it.
					joe

On 11 Sep 2006 07:25:06 -0700, "paul@paullee.com" <paul@paullee.com> wrote:

>Hi everyone,
>What Windows API should I use if I wanted to access the contents of a
>window's contents. For instance, if I were to open a file in Word, or
>browse a site using Explorer, how would I parse the text that I am
>viewing?
>
>TIA
>
>Paul
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
9/11/2006 6:34:10 PM
This sounds exactly like what I am after. btw, how would such
interfaces show up using Dumpbin?

Joseph M. Newcomer wrote:

> This depends on the application.  For some apps, like Word and IE, I believe there are COM
> interfaces that give you the contents of the window.  GetWindowText only works for some of
> the more trivial controls.  But each app is going to be different as to what it supports
> and how it supports it.
> 					joe
>
> On 11 Sep 2006 07:25:06 -0700, "paul@paullee.com" <paul@paullee.com> wrote:
>
> >Hi everyone,
> >What Windows API should I use if I wanted to access the contents of a
> >window's contents. For instance, if I were to open a file in Word, or
> >browse a site using Explorer, how would I parse the text that I am
> >viewing?
> >
> >TIA
> >
> >Paul
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm

0
paul9477 (50)
9/11/2006 7:39:45 PM
> This sounds exactly like what I am after. btw, how would such
> interfaces show up using Dumpbin?
>

COM interfaces are not going to show up in dumpbin. As I had mentioned
it earlier, you will need to go look into the Object Model for each of
these COM servers. These are published objects and provide access to
application data/events/methods.

---
Ajay

0
ajaykalra (6842)
9/11/2006 8:10:40 PM
They wouldn't.  show up in dumpbin, because they are a function of either IDispatch or via
some other COM interface.  You might check the .tlb files, but that isn't always best. You
would have to get the interface specs from the people who develop the app.  In the case of
Word, at least, this is carefully documented, and it might be for IE as well.
					joe

On 11 Sep 2006 12:39:45 -0700, "paul@paullee.com" <paul@paullee.com> wrote:

>This sounds exactly like what I am after. btw, how would such
>interfaces show up using Dumpbin?
>
>Joseph M. Newcomer wrote:
>
>> This depends on the application.  For some apps, like Word and IE, I believe there are COM
>> interfaces that give you the contents of the window.  GetWindowText only works for some of
>> the more trivial controls.  But each app is going to be different as to what it supports
>> and how it supports it.
>> 					joe
>>
>> On 11 Sep 2006 07:25:06 -0700, "paul@paullee.com" <paul@paullee.com> wrote:
>>
>> >Hi everyone,
>> >What Windows API should I use if I wanted to access the contents of a
>> >window's contents. For instance, if I were to open a file in Word, or
>> >browse a site using Explorer, how would I parse the text that I am
>> >viewing?
>> >
>> >TIA
>> >
>> >Paul
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
9/12/2006 2:52:02 AM
Reply:

Similar Artilces:

Get Xml from web .
This is a link to an address where I would like to access xml. http://setiathome2.ssl.berkeley.edu/fcgi-bin/fcgi?cmd=user_xml&email=XXXX The XXXX is the email address of a user. All I want to do is access the xml and view it in a datagrid. I have read several tuturials and articles and have not been able to find something that would explain how to do this. Does anyone know of a sample code or something close I could use as a reference. I am using visualstudio.net. and visual basic. THX Take a look at using the following classes on your app: HttpWebRequest HttpWebResponse DataSe...

Getting Data from Excel Graph onto New Speadsheet
I am trying to get the information that I have plotted, on a scatted graph, off onto the second sheet an splitting the information. I'm not too sure if this is the right place for this thread, but I am hoping that someone can help? The original data that is on the graph is in 3 columns. One has the company name, one is the current value and one is the predicted value. I need this info to come off the graph or from the original data in 2 fields. Customer and predicted value, but they need to be prioritized. 1 needs to be the one with the lowest current and highest potential. 2 needs...

Help! Help content lost (links to 2010?)
When I try to get online Help from Word, I see a page which has the new Office logo for 2010. The framework for Help is provided, but there is no content under any of the headings. ("No results available"). This was from a VBA page, so I was seeking Word Developer help. If I right-click the title "Word Developer Help" and paste the URL property, I get: http://office2010.microsoft.com/client/helphome.aspx?lcid=3081&NS=WINWORD%2EDEV&Version=12 But I'm running Office 2007. I also have Office 2003 installed. How can I get help for Word 2007? Fur...

Get Rich
Take advantage of a great deal ...

Recipients not getting email consistently (internally only.
We have rather a unique situation here. I have a POP3 Linux mail server for my domain (call it domain A) and I also have an exchange server that I have setup. So that users can see the global address book in outlook but still send and receive mail on the POP3 server for now. I have configured it with a list of email addresses but now when users send email to users on this list, they get inconsistent results, sometimes the mail goes to that person, other times Exchange gobbles it up, and wont send it on. I dont want to put everyone on exchange yet, thats why I am maintaining my POP...

Getting information from several surveys in Access
Hi there I have created three surveys which contains information from students. The students complete the surveys at intervals of 3 months so within 1 year a student can have, at most, completed 4 surveys. The pre-survey which is conducted at the start of the year and a survey at the end of the first term. The post survey that is conducted at the end of the second and third terms has elements of the pre-survey and the survey that is conducted at the end of the 1st term. For instance, on questions on how they rate their teachers on a range of topics such as knowledge, ease ...

How to handle a Treasury Bill
MS Money 2005 I record the purchase of a 10K 6-mo T-Bill with the number of shares (10000) and the auction price (say 97.55). as a buy with a quantity and price but no accrued interest. At maturity I try to "redeem CD/Bond" but it does not handle the "accumulated interest" properly; If I put in the amount + interest there's interest left in the register. If I record only the total amount I get at maturity (10000*.9755 + interest) = 10000, the total redeemed is wrong. And to top it off, the entire 10K is shown as interest in the reports section. How should thi...

windows xp professional
After i log on, while uniblue is still running, a 'pop-up' appears next to the hidden icons arrow. It states: "your computer is at risk, no firewall. Click this balloon to protect your computer". Yet when i go into "control Panel" the settings are as they should be. This has happened 1/2 a dozen times. Is my firewall on or off? Thanks.. -- Steve, Horsecamp. Unfortunately, you posted your message in a Dynamics forum. You should post your question in a Windows XP Professional forum. -- Charles Allen, MVP "Steve" wrote: > After i log on, while...

Problems closing Windows Mail
When I try to close WM I get a box saying that WM has stopped working and Windows is looking for a solution. It then restarts and it is suggested I go to check for updates. I don't need to as I keep my computer up to date with all available updates but I did anyway and no updates were availoable. I have scanned for viruses etc but computer is clear. Could WM have become corrupted in some way? How can I solve this? Cannot find a download for WM itself, only Windows Live Mail but I would rather not go down that road. No improvements or updates for Windows Mail have been release...

clearing the immediate window
I've looked into this and I find coding work arounds that I wouldn't expect would be needed after so many years of MS Access. You can do Debug.Print to put info in the immediate window but there doesn't seem to be anything like Debug.Clear. Well that just seems truly odd but typically microsoft so I figured I'd ask here to see if my findings are true. Thanks, Keith There's nothing to clear, why do you need it? or do you mean to clear the immediate window? Keith G Hicks wrote: >I've looked into this and I find coding work arounds that I would...

Windows Defender (Beta2) install?
Should I install Windows Defender (Beta2) on our Exchange2003 Server/Windows 2003 Server? On Mon, 11 Sep 2006 10:59:26 -0700, "Penny Miller" <Penny.Miller@co.chelan.wa.us> wrote: >Should I install Windows Defender (Beta2) on our Exchange2003 Server/Windows >2003 Server? > Absolutely not :) Its a beta. I wouldn't. Honestly, you shouldn't need it. You certainly shouldn't be browsing the net on your servers. "Penny Miller" <Penny.Miller@co.chelan.wa.us> wrote in message news:uKxcGwc1GHA.4116@TK2MSFTNGP02.phx.gbl... > Should ...

Getting started with Macros
Can someone provide a good web site that details how to use macros. I have never used them and I have no idea where to start. Thanks, Ant Hi see: http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Regards Frank Kabel Frankfurt, Germany Ant wrote: > Can someone provide a good web site that details how to use macros. > I have never used them and I have no idea where to start. > > Thanks, > Ant "Ant" <Ant@discussions.microsoft.com> wrote in message news:8B8ADCB9-4F0A-451F-A1F7-0392112AF5AB@microsoft.com... > Can someone provide a good web site tha...

cant get autobudget to pull taxes
I have my paycheck itemized into catagory paycheck. It includes all of my taxes and deductions. When I go to autobudget and select my paycheck it does not pull the tax info over to the budget. I try to edit the values manually but money takes me to a screen to edit the paycheck! I just want to pull the information into my budget. Any ideas? MS money version is 2003. Thanks ...

Windows Explorer: How to get it to expand like I want?
WinXP Pro SP3 When in Windows Explorer, I expand a folders branch using the + sign next to the folders name in the Folders pane. Then I do this to another folders branch using the same technique. I want them both to remain expanded, but when I click on one of the folders in the branch, the other branch closes. I want them both to remain open while I inspect the contents of one of the branch's folders. Is there a way to make it do what I want? TIA Question is what caused this to change? What you ask for is normal behavior. Perhaps you can System Restore to time before it b...

problems with Window.print()
Hello, We have a problem where the Window.print() command does not work from custom forms that are hosted from the isv.config file,After clicking the print button on the print dialog box, it displays the print icon on the internet explorer status bar, but does not send the output to the printer. Any ideas? ...

UART-DMA reception interrupt is not getting
I an facing one problem in UART-DMA combination.In UART-DMA,not able to get the reception interrupt.If the UART driver is not loaded ,but the UART connected to the FPGA the reception interrupt is not getting.Channel 1 is dedicated for reception .But when i remove the UART connection the Abort interrupt is getting.Any one pls help.But the same thing is working in WINXp and Linux Your description is vague. What are you trying to do, how are you trying to do it? What is UART-DMA to you? -- Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geek...

How to get information on un-expected exception?
Hello, All! I have problem with mine application, that it throws exception of un-expected for me type. The only thing I can get is the value of last system error. Can anyone help me to find type of exception, or any additional information, please? Thanks in advance, Voronkov Konstantin ...

how do i get rid of the text box outline around my text?
I hope you're filling your text boxes with more text than you're filling your messages :o) And you just need to read the help files, read the manuals, and look for a button marked Line Color. Set it to No Line. -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading this message, view the disclaimer: http://mvps.org/the_nerd/disclaim.htm > "Ed Bennett" <the_nerd@mvps.org> wrote in message > news:%23bdlu9isEHA.3460@TK2MSFTNGP15.phx.gbl... > > I hope you're filling your text boxes with more text > than you'r...

Windows 98 .pub file isn't recognized by Windows XP
How do I access a .pub file generated with the Microsoft Publisher in Windows 98 in Windows XP Home Edition? It's not the version of *Windows* that matters - it's the version of *Publisher*. Which version of Publisher is loaded on the system with Win XP Home? And which version of Publisher are you using on the Win 98 system? -- JoAnn Paules MVP Microsoft [Publisher] "nhwoods" <nhwoods@discussions.microsoft.com> wrote in message news:8E4976B9-76AE-4E17-92F1-63F5607A67EB@microsoft.com... > How do I access a .pub file generated with the Microsoft Publisher in ...

How to Save All Open Excel Windows??
How can I easily save all open windows in EXCEL? [I have Excel 97.] Thank you. -- Pat (To respond by email please remove "MYPANTS" from the email address at the top.) Excel has an Addin that can accomodate you: 1. Open Excel 2. Click Tools-->Addins 3. Enable/Check the AutoSave Addin and Click OK 4. Click Tool-->AutoSave 5. Choose the "Save All Open workbooks" option 6. (Optionally) Uncheck "Prompt Before Saving". This is not recommended because it will save all open workbooks without notifying you. If you've made any unwanted changes to any open work...

What happens with forms after windows is unlocked
I have several subforms set to function for data entry only (edits, deletes, navigation disabled; additions, data entry enabled). Everything works fine until I lock and unlock my computer. Several seconds after the computer is unlocked both subforms select and display an existing record. In one case it's the first record in the table, in the other a record in the middle and I can't figure out what's special about it. I've tried sticking event handlers on what I though were the most like events to blame but all I've managed to figure out is that whatever is going on is oc...

Confirm window pop up for Firefox, IE but not Chrome
A "Confirm" window pop up for Firefox, IE but not Chrome for my web page with auto refresh every 10 seconds by javascript. How to stop this "Confirm" window from popping up? Operating System: Windows Vista Home URLs (if applicable):http://www.webdeveloper.com/forum/showthread.php? p=1070518#post1070518 Error Message: See the attached doc at the above URL for screen shot. ...

trying to get day/month/year froamt while user enters year only
I am trying to get the end user to enter the year in question and then have the document return values in column A in dd/mmm/yyyy format and column B in Day of week format for all days in that year You would just use something like =DATE(2006,1,ROW()) copied down, but I am not clear where the year number is stored, and when the flip to column B happens. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "RADIOOZ" <RADIOOZ@discussions.microsoft.com> wrote in message news:5A7C3C6F-8AEE-487F-8ADF-62F2234C3858@microsoft.com... > I ...

Macro problem
Hi, I have a spreadsheet for keeping track of my golf scores. The spreadsheet uses a macro for copying the scores to a database sheet and to a statistics sheet. When running this macro the process fails on the statistics sheet. It involves copying 2 matrices from the scorecard sheet to the statistics sheet. If I uninstall the security updates for Excel 2007 in Windows 7 the spreadsheet works like a charm. I usually just removes all excel updates and unchecks updates for excel in Windows Update. However, now I have this update, that keeps installing itself after a reboot (KB982308). I ...

Outlook 2002 with Windows Vista
I have just installed Outlook 2002, as part of Office XP, into my new laptop that has Windows Vista. I was using the trial version of Office 2007, but I uninstalled it when I did not buy it. Outlook was working fine. Also, Outlook 2002 was working fine on my other computer with Windows XP. Every time I run Outlook now, and then do a Send/Receive, it asks for passwords for my two email accounts. Then when I check my email accounts under Tools, Email Accounts, then View or change existing email accounts, then change each email account, in the section for logon information, there is a box ...