Listbox Notification message
<p>I am trying to prevent items from being selected in listbox that matches specified condition. After some MSDN Study I came to know that LBN_SELCHANGE is sent to it's parent window via WM_COMMAND so I tried
to hook LBN_SELCHANGE message sent by the list box on OnNotifyMessage as below.</p>

<pre><code> public class SimpleListBox:ListBox
{
    public SimpleListBox()
    {
        SetStyle(ControlStyles.EnableNotifyMessage, true);
    }
    private const int LBN_SELCANCEL = 0x3;
    private const int LBN_SELCHANGE = 0x1;
    protected override void OnNotifyMessage(Message m)
    {
        switch (m.Msg)
        {
            ////http://msdn.microsoft.com/en-us/library/bb775161(VS.85).aspx
            case (int)WindowsMessages.WM_COMMAND: //0x111
                if (((int)m.WParam).LoWord() == LBN_SELCHANGE)
                {
                    int i = 0;
                }
                break;
        }
        base.OnNotifyMessage(m);
    }

}
</code></pre>

<p>But This seems not working, please guide me if I have missed something.
Thanks in advance.</p>
