Force other programs to perform actions

Posted on 2004-11-15
Last Modified: 2010-04-23
I have 2 programs
1: my own program programmed in
2: remote capture software for a camera

In the #2 program, when i press F2 it makes a shot.

i need to be able to do the following actions:
1. when i press a button in my program - say "Take" - my program should somehow pass this action as and F2 command to the program #2.
2. when the #2 program gets activated (if it does), i want my program to activate itself in a second.

I guess there is a way to do it, but i know nothing about switching between programs.
Can someone please put detailed explanation for me here?

Question by:UnFiRe
    LVL 14

    Expert Comment

    Not sure how to do that, but I would try adding a reference to your app and looking at the list of COM components that are available.  Many commercial programs expose a programmatic interface to them that would allow you to take "remote control"...
    LVL 5

    Accepted Solution

    There is a sort of chessey way of doing it using send keys.

    Lets say you hit a button in your applicatoin. It would then exec the following example

    'activate other app
    AppActivate("Name of other app") 'the name you can find in the task manger
    'now send keys
    'now return to you rapp
    AppActivate("Name of YOUR app")

    'Thats a way to do it, with out a DLL/COM ext from the other app.

    All so, here are 2 links at MSDN on the 2 functions used in the above example.

    Thanks and GL
    LVL 1

    Author Comment

    Jojo, that worked,
    Thanks a lot!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now