You need the HWnd of the window that's going to receive the message, and use the
PostMessage
Windows API method (see pinvoke.net for details and prototypes). You should also only have to send the
WM_LBUTTONUP
to get the desired result. Next, you're going to have to google
WM_LBUTTONUP
to see what parameters to set in the
PostMessage
method call.
Here's the stuff you need for
PostMessage:
using System.Runtime.InteropServices;
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)]
static extern bool PostMessage(IntPtr hwnd, uint Msg, IntPtr wParam, IntPtr lParam);