[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Force other programs to perform actions

Posted on 2004-11-15
3
Medium Priority
?
175 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:UnFiRe
3 Comments
 
LVL 14

Expert Comment

by:ptakja
ID: 12590083
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
 
LVL 5

Accepted Solution

by:
Jojo1771 earned 2000 total points
ID: 12590154
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
 
LVL 1

Author Comment

by:UnFiRe
ID: 12600486
Jojo, that worked,
Thanks a lot!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Loops Section Overview
Suggested Courses

873 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