Using WM_Close in c#
<p>I am using the below code to exit a process programatically.
since i am new to this concept. I want to know how to use this below code.</p>

<p>Logic : I will have the process name to be terminated, i shud assign that to
this function.</p>

<p>Say if want to terminate a notepad, how to pass parameter [Process Name] 
to this function ?</p>

<pre><code>    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
    static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
    static uint WM_CLOSE = 0xF060;

    public void CloseWindow(IntPtr hWindow)
    {
        SendMessage(hWindow, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
    }
</code></pre>
