CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Location
    Salisburyl UK
    Posts
    324

    Pressing Buttons and getting text from another application

    Hi All..

    I would like to write an application to automate the limited functionality of another application.

    I am thinking of using system wide hooks to watch for the creation of the application I want to automate.

    Will I then be able to send the application messages to simulate user button presses and read text in particular text boxes ??

    I have been out of the software business for 6 years now, so please bare with me while I catch up a little !!

    Any help or advice on how best to achieve this would be very welcome.

    I am using Visual Studio 6 (a little out of date now ?)

    Many thanks in advance !

    Philip

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

    Re: Pressing Buttons and getting text from another application

    Quote Originally Posted by Phill Heald View Post
    I am using Visual Studio 6 (a little out of date now ?)
    A lot out of date now.

    For the maximum amount of control and reliability manipulating the UI of another app, check out using the Active Accessibility interfaces.

    AA allows you to manipulate the controls of another application that you normally can't manipulate with the standard windows api's. For example, selecting a tree node by a specific name can't be performed using Win32 api's because they don't have the ability to 'see' and individual tree node. Sure, you can click on a node by sending a mouse click, but this is not very reliable because it depends on the position of the tree node (what happens new node are added), resolution and other things. With AA, you can find a specific node and select it (even if it off the page).

    This article discusses AA and provides some sample code. You'll be interested in the client code, not the server code.
    http://www.codeproject.com/KB/winsdk...px?msg=1985115

    Download the AA Explorer tool here
    http://www.microsoft.com/downloads/d...displaylang=en

    The AA Explorer lets you inspect the target application to discover its AA attributes.

    Note: there's a bit of a learning curve to understanding Active Accessibility.

  3. #3
    Join Date
    Sep 1999
    Location
    Salisburyl UK
    Posts
    324

    Re: Pressing Buttons and getting text from another application

    Hi Arjay
    Thanks for your reply. Glad to see your still here !
    Ill check out the articles you suggest.
    Thanks again
    Cheers
    Philip

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