Solved

How to send button down to  a button of another WPF C# application

Posted on 2011-03-17
6
395 Views
Last Modified: 2013-12-17
I wrote an WPF C# application (called slave application)  that have a button. When click on it, it will perform a task.
Now I launch 10 copies of this slave application.
I will like to be able to create another C# application (called master application) with a buttton. When click on this button in the master application , it will as if I have manually clicked on each of the button of the 10 copies of the slave application.

Did anyone have any idea how I can achieve that?
0
Comment
Question by:tommym121
6 Comments
 
LVL 7

Expert Comment

by:nbove
ID: 35161308
1)  Ensure that the method responsible for handling the button click in the "Slave" application is marked as public.

2) In the event handler of the button click in the "Master" application, iterate over each "Slave" application instance and call the method responsible for handling the button click.
0
 

Author Comment

by:tommym121
ID: 35161703
Any code example to show how this to be done.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 400 total points
ID: 35371698
I would suggest something more along the lines of IPC (Interprocess Communication).  You could use a TCP/IP socket, .NET remoting, or a named pipe.

Simple Inter-Process Communication In VB.Net
http://anoriginalidea.wordpress.com/2007/08/09/simple-inter-process-communication-in-vbnet/

.NET 3.5 Adds Named Pipes Support
http://www.switchonthecode.com/tutorials/dotnet-35-adds-named-pipes-support

Socket Send and Receive [C#]
http://www.csharp-examples.net/socket-send-receive/
0
 
LVL 25

Assisted Solution

by:apeter
apeter earned 100 total points
ID: 35376387
If slave and master application are in the same system and named pipe is the best choice.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

828 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