1

I have a WPF application and a MFC application. I want to do a two communication between them. I can use SendMessage in mfc application to send messages to WPF application. How can I do the same in WPF application?

1
  • 1
    Just pinvoke SendMessage(). Do consider a better mousetrap like named pipes or sockets, much easier to find the other end and much easier to use in a WPF app. Commented Jun 30, 2013 at 13:57

1 Answer 1

1

If you can do it in MFC, then you can do it in C# too by importing the SendMessage API call:

[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, StringBuilder lParam);

You can find sample usage of SendMessage in this link.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.