CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2007
    Posts
    13

    Question Can a program control or access data from another?

    Sorry if this sounds dumb, but is it possible to control or gain access to data in other applications? I'm not talking about making a macro type program that has predefined mouse movements and timings, but a program that can "tap" into another and access its data, or invoke some of its functions.

    I don't have any specific program in mind or specific example, I'm just curious as to how one could achieve something like this. I looked into this with Java, but no one seems to have an answer (or good one at that), so I'm trying my luck with c#. Any help would be appreciated, thanks.

  2. #2
    Join Date
    Nov 2004
    Posts
    105

    Re: Can a program control or access data from another?

    Remoting will do.

    google it!..
    Ravi.Battula

  3. #3
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    1,080

    Re: Can a program control or access data from another?

    It depends what applications you're talking about. If you mean two of your own applications that have been written from the ground up to support it then Remoting is a leading candidate in .NET. If you mean that you want to interact with an application that you haven't created yourself then it's a bit more difficult. You can interact with a third-party UI via Windows API functions and Windows messages. Getting data not exposed via the UI would require reading memory directly, which is hairier still and would require a fair amount of trial and error.
    Tutorials: Home & Learn | Start VB.NET | Learn VB.NET | C# Station | GotDotNet | Games in VB.NET 101 Samples: 2002 | 2003 | 2005 | More .NET 2.0 (VB.NET, C#) Articles: VB.NET | C# | ASP.NET | MoreFree Components: WFC | XPCC | ElementsEx | VBPP | Mentalis | ADO.NET/MySQL | VisualStyles | Charting (NPlot, ZedGraph) | iTextSharp (PDF) | SDF (CF) ● Free Literature: VB 2005 (eBook) | VB6 to VB.NET (eBook) | MSDN Magazine (CHM format) ● Bookmarks: MSDN | WinForms .NET | ASP.NET | WinForms FAQ | WebForms FAQ | GotDotNet | Code Project | DevBuzz (CF) ● Code Converter: C#/VB.NET | VB.NET/C# | VS 2005 add-in

  4. #4
    Join Date
    Sep 2007
    Posts
    13

    Re: Can a program control or access data from another?

    It would be one of my application interfacing with someone elses, that I know nothing about. Could you elaborate on the third-party UI examples via Windows API function and messages, I think that's what I'm after.

    Thanks

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Can a program control or access data from another?

    Quote Originally Posted by chobo
    It would be one of my application interfacing with someone elses, that I know nothing about. Could you elaborate on the third-party UI examples via Windows API function and messages, I think that's what I'm after.

    Thanks
    You'll probably have the best results using Active Accessibility. The standard windows api approach doesn't work on many types of controls (e.g retrieving the text from the 2nd column of a selected list control item).

    Search google for Active Accessibility and UI Automation.

  6. #6
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    1,080

    Re: Can a program control or access data from another?

    Quote Originally Posted by Arjay
    You'll probably have the best results using Active Accessibility. The standard windows api approach doesn't work on many types of controls (e.g retrieving the text from the 2nd column of a selected list control item).

    Search google for Active Accessibility and UI Automation.
    Sounds like something I could make use of myself.
    Tutorials: Home & Learn | Start VB.NET | Learn VB.NET | C# Station | GotDotNet | Games in VB.NET 101 Samples: 2002 | 2003 | 2005 | More .NET 2.0 (VB.NET, C#) Articles: VB.NET | C# | ASP.NET | MoreFree Components: WFC | XPCC | ElementsEx | VBPP | Mentalis | ADO.NET/MySQL | VisualStyles | Charting (NPlot, ZedGraph) | iTextSharp (PDF) | SDF (CF) ● Free Literature: VB 2005 (eBook) | VB6 to VB.NET (eBook) | MSDN Magazine (CHM format) ● Bookmarks: MSDN | WinForms .NET | ASP.NET | WinForms FAQ | WebForms FAQ | GotDotNet | Code Project | DevBuzz (CF) ● Code Converter: C#/VB.NET | VB.NET/C# | VS 2005 add-in

  7. #7
    Join Date
    Sep 2007
    Posts
    13

    Re: Can a program control or access data from another?

    Could any of these techniques work on programs written in Java? I've downloaded a program called winspectory spy and it shows windows messages and other stuff.

  8. #8
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Can a program control or access data from another?

    Quote Originally Posted by chobo
    Could any of these techniques work on programs written in Java? I've downloaded a program called winspectory spy and it shows windows messages and other stuff.
    Sure it's possible. To check download the Active Accessibility SDK Tools and use AccExplorer32.exe on your java application.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured