Solved

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

Posted on 2011-03-17
6
392 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

815 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

12 Experts available now in Live!

Get 1:1 Help Now