c# and wm api

  • Thread starter Thread starter Bob Allen
  • Start date Start date
B

Bob Allen

I am using c# to try and scrape a terminal screen to get some data. I have
been able to figure out how to use the FindWindowEx to get the window
handle. Now i'm at a lose. I have tried using WM_GETTEXT with the
WM_GETTEXTLENGTH. This works in getting data out of a text box or combo box.
It however does nothing when working in a terminal window. Can someone point
me in the right direction in how to scrape some data out of a terminal
window? If someone also had a sample of how to get the line of data that
they are on would be helpful also. Any help is greatly appreciated.

Thanks,
Bob;
 
Bob said:
I am using c# to try and scrape a terminal screen to get some data. I have
been able to figure out how to use the FindWindowEx to get the window
handle. Now i'm at a lose. I have tried using WM_GETTEXT with the
WM_GETTEXTLENGTH. This works in getting data out of a text box or combo
box. It however does nothing when working in a terminal window. Can
someone point me in the right direction in how to scrape some data out of
a terminal window? If someone also had a sample of how to get the line of
data that they are on would be helpful also. Any help is greatly
appreciated.

Thanks,
Bob;

Hi Bob,

I'm afraid that'll be nigh on impossible, due to Microsoft's implementation
of the terminal window - unless of course you use OCR to detect
characters - but let's not get into that.

However, there may be an alternative way to do what you're trying to do...
I'm going to take a shot in the dark, but are you trying to capture the
output from a console application that *you* are executing, from your own
code? If that's the case, then there's a solution for you, involving
redirecting Standard Out.
 
Thanks for the input but sadly no. I am trying to get the data from a
terminal emulation screen that is not my program. I am working on a program
that will take the data on the terminal emul screen and output it to an html
page.
 
Bob said:
Thanks for the input but sadly no. I am trying to get the data from a
terminal emulation screen that is not my program. I am working on a
program that will take the data on the terminal emul screen and output it
to an html page.

Hi Bob,

Sorry, I may have not been entirely clear... I meant, do you execute the
console application, using System.Diagnostics.Process?
 
Bob said:
I am using c# to try and scrape a terminal screen to get some data. I have
been able to figure out how to use the FindWindowEx to get the window
handle. Now i'm at a lose. I have tried using WM_GETTEXT with the
WM_GETTEXTLENGTH. This works in getting data out of a text box or combo box.
It however does nothing when working in a terminal window. Can someone point
me in the right direction in how to scrape some data out of a terminal
window? If someone also had a sample of how to get the line of data that
they are on would be helpful also. Any help is greatly appreciated.

Thanks,
Bob;

You can always have a look at PowerTCP's offerings they have a managed
terminal service emulator library in their product lineup. It might do
the trick for you.

http://www.dart.com/dotnet/emulation.asp
http://www.dart.com/dotnet/telnet.asp

A review can be found at the following location (though it's from 2003,
so it might be out of date).
http://www.fawcette.com/vsm/2003_08/magazine/departments/firstlooks/


Jesse
 
Back
Top