.NET Equivalent to an Active-X Control??

G

Guest

Here's a nifty one

I need to locate text fields of a running legacy application on a user's desktop, scrape data from the text field controls, and bring it back into my application. Currently this behavior is accomplished from a VB6.0/C++ thick client application that uses FindWindow() etc... WIN32 APIs to locate text controls and retrieve text data. We would like to upgrade the VB6.0 application to a .NET C#/ASP web app. Is there ANY way to accomplish the screen scrape task from a .NET web application? I know that I could do this task from an Active-X control, and that I can create an Active-X control for use with my .NET app, but yikes I'd rather not! Questions

1) I don't see any way to do this with a server side control as it is the client's desktop that must be scraped. Is there any .NET equivalent to an Active-X control --> something that will let me get access to legacy PInvoked WIN32 APIs outside of a sandbox
2) If there is a .NET Active-X control equivalent then I would assume that I will need the .NET framework on my client - yes? If so is there a web based equivalent to the dotnetfx.exe installer, one that will work for .NET platforms ranging from 98/NT to XP?

--Richar
 
A

Andreas Håkansson

Richard,

There is no way, out of the box, to get a hold of a textbox in a remote
process, but there is nothing stopping your from using p/Invoke to call the
FindWindow API or other API's you would like to use. For example.

using System;
using System.Runtime.InteropServices;
public class Win32
{
private Win32
{
}

[DllImport("User32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern IntPtr FindWindow(
string className, string windowName);
}

And then call it like a normal static method;

IntPtr hWnd = Win32.FindWindow("", "");

HTH,

//Andreas

Richard said:
Here's a nifty one:

I need to locate text fields of a running legacy application on a user's
desktop, scrape data from the text field controls, and bring it back into my
application. Currently this behavior is accomplished from a VB6.0/C++ thick
client application that uses FindWindow() etc... WIN32 APIs to locate text
controls and retrieve text data. We would like to upgrade the VB6.0
application to a .NET C#/ASP web app. Is there ANY way to accomplish the
screen scrape task from a .NET web application? I know that I could do this
task from an Active-X control, and that I can create an Active-X control for
use with my .NET app, but yikes I'd rather not! Questions:
1) I don't see any way to do this with a server side control as it is the
client's desktop that must be scraped. Is there any .NET equivalent to an
Active-X control --> something that will let me get access to legacy
PInvoked WIN32 APIs outside of a sandbox?
2) If there is a .NET Active-X control equivalent then I would assume that
I will need the .NET framework on my client - yes? If so is there a web
based equivalent to the dotnetfx.exe installer, one that will work for .NET
platforms ranging from 98/NT to XP?
 
N

Nicholas Paldino [.NET/C# MVP]

Richard,

You can embed a .NET control in a web page. Check out the article
titled "Using Windows Forms Controls in Internet Explorer" located at (watch
for line wrap):

http://windowsforms.net/articles/iesourcing.aspx

And yes, you are right, the client will have to have the .NET framework
installed. However, the problem you will run into is that you will have to
set the security settings on the client so that it will allow the control to
access other applications/windows. By default, I imagine you won't have the
rights to do this, as this is a security concern.

You might also want to consider just developing an ActiveX control which
will do this as well, and embedding it in an ASPX page.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Richard said:
Here's a nifty one:

I need to locate text fields of a running legacy application on a user's
desktop, scrape data from the text field controls, and bring it back into my
application. Currently this behavior is accomplished from a VB6.0/C++ thick
client application that uses FindWindow() etc... WIN32 APIs to locate text
controls and retrieve text data. We would like to upgrade the VB6.0
application to a .NET C#/ASP web app. Is there ANY way to accomplish the
screen scrape task from a .NET web application? I know that I could do this
task from an Active-X control, and that I can create an Active-X control for
use with my .NET app, but yikes I'd rather not! Questions:
1) I don't see any way to do this with a server side control as it is the
client's desktop that must be scraped. Is there any .NET equivalent to an
Active-X control --> something that will let me get access to legacy
PInvoked WIN32 APIs outside of a sandbox?
2) If there is a .NET Active-X control equivalent then I would assume that
I will need the .NET framework on my client - yes? If so is there a web
based equivalent to the dotnetfx.exe installer, one that will work for .NET
platforms ranging from 98/NT to XP?
 
G

Guest

Yes but as I stressed in my question --> I need to probe the CLIENT's desktop; PInvoke on a server side control will probe the server's desktop. The question is how to scrape data from a WIN32 control on the CLIENT desktop. Any ideas would be greatly appreciated..
 

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

Top