473,395 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Extracting Text from another Application

Hello,

I read through this thread regarding FindWindowEx vs.
EnumChildWindows:
http://www.xtremevbtalk.com/showthread.php?t=130418

It looks like it was done in VB6, can this be done in VB.NET? I am
trying to extract information from a very old desktop application
that doesn't support copy/paste.

Our client doesn't want to look up the information, write down, for
example a telephone number and then open up another application and
re-enter the information in.

In the above example it shows how to send information like "Hello
World" into a textbox in another application. Can we do the opposite?
Extract information and send it to my custom application?

Thanks in advance!

Chris
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #1
1 7766
In article <40**********@Usenet.com>, Trancedified wrote:
Hello,

I read through this thread regarding FindWindowEx vs.
EnumChildWindows:
http://www.xtremevbtalk.com/showthread.php?t=130418

It looks like it was done in VB6, can this be done in VB.NET? I am
trying to extract information from a very old desktop application
that doesn't support copy/paste.

Our client doesn't want to look up the information, write down, for
example a telephone number and then open up another application and
re-enter the information in.

In the above example it shows how to send information like "Hello
World" into a textbox in another application. Can we do the opposite?
Extract information and send it to my custom application?

Thanks in advance!

Chris
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com


As long as the control that has the text you want to extract the text
from has a window handle, then yes it is possible using either
GetWindowText or using SendMessage and WM_GETTEXTLENGTH and
WM_GETTEXT... After you locate the window of course :)

You can declare the functions with almost the same syntax in VB.NET -
the major difference is that the data types will be different.

For example, EnumChildWindow:

Private Delegate Function EnumChildProcDelegate _
(ByVal hWnd As IntPtr, _
ByVal lParam As Integer) As Boolean

Private Declare Function EnumChildWindows Lib "user32" _
(ByVal hWndParent As IntPtr, _
ByVal lpEnumFunc As EnumChildProcDelegate, _
ByVal lParam As Integer) As Boolean

Then you would have a function in your class/module/form

Private Function EnumChildProc _
(ByVal hWnd As IntPtr, ByVal lParam As Integer) As Boolean

...
End Function

You wold call EnumChildWindows like this:

' Assuming in a form, keep the delegate so GC doesn't interfer
Dim proc As New EnumChildProcDelegate(AddressOf Me.EnumChildProc)
EnumChildWindows(Me.Handle, proc, 0)

Anyway, that is just one example (and probably the hardest one to do :)
Just remember that in VB.NET the data sizes have changed, for example in
VB6 Integer is 16-bit and Long is 32-bit. In VB.NET Integer is 32-bit
and Long is 64-bit. So, basically in VB.NET you use Short where you
used Integer in VB6, Integer where you used Long (or Boolean), etc.

HTH
--
Tom Shelton [MVP]
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nazgul | last post by:
Hi! I want to implement a small tool in Python for distributing "patches" and I need Your advice. This application should be able to package all files chosen by a user into a self-extracting.exe...
2
by: Avi | last post by:
hi, Can anyone tell me what the problem is and how to solve it The following piece of code resides on an asp page on the server and is used to download files from the server to the machine...
2
by: Shawn | last post by:
I have an XML file that contains nodes and I'm having no problem extracting the information using ASP. However I can't seem to get the ID number from the deliverrequest node from the example below....
5
by: Michael Hill | last post by:
Hi, folks. I am writing a Javascript program that accepts (x, y) data pairs from a text box and then analyzes that data in various ways. This is my first time using text area boxes; in the past,...
27
by: gRizwan | last post by:
Hello all, We have a problem on a webpage. That page is sent some email data in base64 format. what we need to do is, decode the base64 data back to original shape and extract attached image...
2
by: Kevin K | last post by:
Hi, I'm having a problem with extracting text from a Word document using StreamReader. As I'm developing a web application, I do NOT want the server to make calls to Word. I want to simply...
2
by: Dave G | last post by:
I'm writing a function to look for particular emails in my Inbox and when it finds one it copies the attachment to a folder and then deletes the email. It spots the email by looking for certain...
6
by: Mag Gam | last post by:
Hi All, I am new to XML, and trying to extract some data from a file. The file looks like this: <CATALOG> <CD> <TITLE>Empire Burlesque</TITLE> <ARTIST>Bob Dylan</ARTIST>...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.