Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

how to screen scrape from a windows text box


I want to write or obtain C++ code that will scrape text from a dialog
box within a poker client, and then record that text somewhere else.

What do I do? Thanks.

Well, the first thing to do is post to the correct newsgroup. This is the C#
language group. For C++ code, you need the C++ group.

Aside from that, screen scraping is done pretty much the same way regardless
of whether from a windows app or a web app.
Peter

--
Site:  http://www.eggheadcafe.com
UnBlog:  http://petesbloggerama.blogspot.com
Short urls & more:    http://ittyurl.net

What do you mean by "scraping text"? Getting all dialog's child control's
captions?

Look at Win32 GetWindow() and GetWindowText() functions.

You'll need to call GetWindow(), starting with the parent dialog's HWND,
recursively. For each obtained child window's HWND, call GetWindowText().
That'll do it...

TCHAR tchWindowText[5000];

void SaveText( HWND hwndParent )
{
  // Get the current window's caption.
  GetWindowText( hwndParent, tchWindowText, 5000 ); // Save this text
wherever.

  // Get all the child windows
  HWND hwndChild;
  while( ( hwndChild = GetWindow( hwndParent, GW_CHILD ) ) != NULL )
    SaveText( hwndChild );

  // Now process all siblings of this window.
  HWND hwndSibling;
  while( ( hwndSibling = GetWindow( hwndParent, GW_HWNDNEXT ) ) != NULL )
    SaveText( hwndSibling );

}

// Call this with the dialog's HWND.
SaveText( hwndDialog );

<WFD@gmail.com> wrote in message

news:1180461217.691695.321390@m36g2000hse.googlegroups.com...

Peter Bromberg [C# MVP] wrote:

> Well, the first thing to do is post to the correct newsgroup. This is the C#
> language group. For C++ code, you need the C++ group.

Good advice.

> Aside from that, screen scraping is done pretty much the same way regardless
> of whether from a windows app or a web app.

Web screen scraping consist of sending a HTTP request and pulling
the right information out of the returned HTML - often done using
regex.

I would expect screen scraping a win form to be very different.

Arne

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc