screen scraping question

  • Thread starter Thread starter Kevin Dombroski
  • Start date Start date
K

Kevin Dombroski

Howdy - I'm trying to get some info from another window. In the past, I have
succesfully used code like the following to get the text from a control on
another window (when the class type is RICHEDIT). However, I have
encountered a window control whose class is "AfxWnd42s", and using
WM_SENDMESSAGE ( ... GETTEXT...) is NOT working. I have verified w/ Spy++
"Find Window" tool and the debugger that the window handle I am obtaining is
correct.

Can someone tell me another method so that I can get the text from an
"AfxWnd42s" control? Please let me know - thanks!
My email: (e-mail address removed)_removeAllofThisTrailingText
NoSpAm****removeAllofThisTrailingText


Code snippet that works for "RICHEDIT", but not for "AfxWnd42s":

IntPtr the_one = Win32.FindWindowEx(WinHnd, 0, "AfxWnd42s",
null);
StringBuilder formDetails = new StringBuilder( 65000 );
Int32 result1 = Win32.SendMessage(the_one, Win32.WM_GETTEXT,
65000, formDetails);
 
Unless the other window supports the WM_GETTEXT method, there's no
straightforward way of getting the text of any arbitrary control.

If the other window belongs to a different process, then, you're talking
about Inter Process Communication. The Windows Shell devs put in a lot of
code behind the WM_GETTEXT message for the text controls to be able to pass
data between processes. The same may not be true for all controls.

-vJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top