1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Automating Windows tasks with software that doesn't have an API?

Discussion in 'General Programming Chat' started by madblacker, May 27, 2010.

  1. madblacker

    madblacker Regular Member

    Joined:
    Nov 2, 2009
    Messages:
    268
    Likes Received:
    19
    I'm wondering if anyone on here does anything like this, basically I want to automate some windows tasks but the software doesn't have an API so is there any other way to do this Besides using macros (i've used these before they are too messy, error prone cus one thing thats unexpected breaks it, you can't get any feedback from the program to account for errors, delays, etc)... I've been looking into packet sniffers that I think like packet sniff different layers of windows that maybe can get the data going from the GUI to the deepers "layer" of the OS but its kind of hard for me to follow along with some of the stuff I've read about this.. any info is appreciated
     
  2. goawayplease

    goawayplease Regular Member

    Joined:
    Apr 10, 2008
    Messages:
    299
    Likes Received:
    67
    If I'm understanding you right, you want to hook into an existing piece of software that doesn't have any method of doing so.

    If the software is MS Windows based, you can use VB and the Windows API to hook the GUI Window and send calls to it.

    Back in the day, Pat or JKs API Spy was what everybody used for this.

    http://patorjk.com/programming/tutorials/apispy.htm

    The general gist of the technique is that you use the API spy to find the GUI Handle(the unique name of the window when it's loaded into memory), and from there you write a VB App that uses the existing Windows 32Bit API to make calls directly to that window. You can do stuff like click buttons, populate form data, etc.
     
    • Thanks Thanks x 1
  3. madblacker

    madblacker Regular Member

    Joined:
    Nov 2, 2009
    Messages:
    268
    Likes Received:
    19
    Yeah... you got it, thats exactly what i want to do... thanks for the info this helps me a lot, I am going to hire some vb.bet programmers to try this
     
  4. morgi666

    morgi666 Registered Member

    Joined:
    Jan 14, 2010
    Messages:
    69
    Likes Received:
    17
    I'm always using AutoIt for stuff like this. It can handle gui, your keyboard, mouse and do everything you do, plus it's quite easy to learn if you will look on examples.
     
  5. morgi666

    morgi666 Registered Member

    Joined:
    Jan 14, 2010
    Messages:
    69
    Likes Received:
    17
    I'm always using AutoIt for stuff like this. It can handle gui, your keyboard, mouse and do everything you do, plus it's quite easy to learn if you will look on examples.
     
  6. morgi666

    morgi666 Registered Member

    Joined:
    Jan 14, 2010
    Messages:
    69
    Likes Received:
    17
    I'm always using AutoIt for stuff like this. It can handle gui, your keyboard, mouse and do everything you do, plus it's quite easy to learn if you will look on examples.