sendmessage (coredll)
Last changed: -77.244.75.200

.

[DllImport("coredll.dll", CharSet = CharSet.Auto, SetLastError = false)]

static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

Ex:

Process p = Process.GetProcessById((int)pe.ProcessID);

if (p.MainWindowHandle != IntPtr.Zero)

SendMessage(p.MainWindowHandle, (uint)OpenNETCF.Win32.WM.CLOSE, IntPtr.Zero, IntPtr.Zero);