Force other programs to perform actions

I have 2 programs
1: my own program programmed in vb.net
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?

Thanks
LVL 1
UnFiReAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ptakjaCommented:
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"...
0
Jojo1771Commented:
There is a sort of chessey way of doing it using send keys.

Lets say you hit a button in your vb.net 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
   SendKeys.Send("{F2}")
'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


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformssendkeysclasstopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmappactivate.asp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
UnFiReAuthor Commented:
Jojo, that worked,
Thanks a lot!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.