I have been experimenting with Sending Messages from 2 .NET Winform applications using WM_COPYDATA
.. works great.
What I would like to know is if that can be accomplished with Console applications.
After all the SendMessage
function takes in a window handle, so how can I get the window handle of a console application ?
[DllImport("User32.dll")]
public static extern Int32 SendMessage(int hWnd, int Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] string lParam);
Also do I need to setup some kind of message Loop in the console application to be able to receive messages ?