-2

I am developing two windows apps, sender and receiver, in C#. In the sender, I want to have a text box for keying in the string message, and button "send".

On the other hand, I want to have a windows app receiver, receiving the string message in a textbox.

I couldn't find any step-by-step tutorial specifically on app to app, although have found quite feel on app to notepad... I have no idea how to convert those to-notepad code to to-window-app-textbox one.....

Here is what I found about app to notepad:

http://www.codingvision.net/miscellaneous/c-send-text-to-notepad

Anthon
  • 69,918
  • 32
  • 186
  • 246
Curly
  • 539
  • 2
  • 7
  • 14
  • 1
    Using SendMessage() to do this is a fairly bad idea, discovering the window handle is tricky and the string has to be marshaled across the process boundary. Technically you can do it with WM_COPYDATA. But do consider the .NET interop mechanisms first. A socket, named pipe or WCF. – Hans Passant Jun 02 '15 at 16:40
  • Are there any examples/tutorials of this kind? Thanks! – Curly Jun 02 '15 at 16:56
  • @Curly Yes, [490000 of them](https://www.google.com/search?q=wcf+tutorial+c%23) – Scott Chamberlain Jun 02 '15 at 18:56
  • Sorry, that is not what I am asking for though.... – Curly Jun 02 '15 at 19:05

1 Answers1

0

You could look into a Memory Mapped File between your applications. You need to decide on a messaging system/protocol and send the messages through a shared memory tunnel(s) between you app and others as needed.

Also, look at what SignalR is doing. It is placing the messaging on the transport layer.

Ross Bush
  • 14,648
  • 2
  • 32
  • 55