• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

Talk to other apps


I'm using vb.net and Simply Accounting, I'm wondering if there would be a way to talk to Simply Accounting from vb.net while it's open.

For example, say I'm in my app in VB, I have simply accounting open, would there be a way from vb to tell simply accounting to perform some type of action, like open a window or a menu in simply accounting? Kind of like launching a recorded macro, a set of pre-recorded actions?

Is there an app I can download that records actions performed, which I can later launch from vb.net? Are there any possibilities to do this?
1 Solution
Mike TomlinsonMiddle School Assistant TeacherCommented:
Yes, you can "talk" to other apps, but the way in which you do so depends on the target application.  Some apps actually have an open API that specifically allows you to communicate with it and make requests.  I don't know if Simply Accounting has any type of automation software for it.

For software that doesn't directly support automation, you can usually just simulate keystrokes as if they were typed by the user.  There are two general approaches though:
(1) Simulated keystrokes that are caught by whatever application happens to be in focus at the time.
(2) Directed keystrokes that are sent to the application itself.

Approach #1 is easy, but has the drawback that the target app has to be in focus.  If another app is focused then it will get the keystrokes instead of your intended target.  It is possible to force focus to the target app, but this may not work depending on the current settings of the OS.

Approach #2 doesn't require the app to be in focus, but is much harder to implement as it requires the use of lower level windows APIs and some trial and error to determine which windows (or child-window) in the target app is the correct recipient.

There are some free third-party tools, however, for just this purpose.  "AutoIt" is pretty commonly used and versatile:

    "AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!"

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now