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? Any sample program that demostrates that?
Loading
Sam HobbsPosted Mar 30, 2011, 11:33 PM
I am curious about this so I will try to look at this more later. I don't know WPF very well but I assume this is something worth exploring.
Tommy MillerPosted Mar 30, 2011, 11:07 PM
Sam HobbsPosted Mar 27, 2011, 8:01 PM
Using sendkeys and things like that is more work and/or less reliable; it is more work becasue there is so much to do to make it reliable.
Do you need help determining the control id for each control? Do you need help sending the message?
Okay, I have looked at your question again. When you create each instance of the slave, you will have a process for each instance. You can get the window (form or whatever) for each process. I am not sure if there is a control id for a button in a WPF application. Perhaps there is an equivalent way to do this for WPF applications; I am not familiar with WPF.
VulpesPosted Mar 27, 2011, 10:10 AM
Tommy MillerPosted Mar 27, 2011, 9:59 AM
I can create my master using form. How would I send a click event to a specific button where I multiple buttons with the same label? Even they have same labels, their name is unique.
VulpesPosted Mar 26, 2011, 8:33 PM
See this thread (http://www.c-sharpcorner.com/Forums/Thread/112138/sending-data-from-one-aplciation-to-another-application.aspx) for some sample code.
If you want to leave the master applicaton as WPF then, as there's no SendKeys equivalent, you could try using the API function, keybd_event instead - see http://www.pinvoke.net/default.aspx/user32.keybd_event.