I'm trying to watch WndProc as it creates an application window. I want to see all the messages that it sends, but I don't want to interrupt the sending of these messages. This seems to be happening. For example, if I use this code:
That just adds the message's contents to a listview so I can see it, but now it won't let me resize my form. It adds the message to the list, but apparently it doesn't send it to the program. Is there a way I can accomplish this?
Code:
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == 0x84)
{
backgroundWorker1.RunWorkerAsync(m);
}
}
private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
Message m = (Message)e.Argument;
ListViewItem lvi = new ListViewItem(m.HWnd.ToString());
lvi.SubItems.Add(m.LParam.ToString());
lvi.SubItems.Add(m.Msg.ToString());
lvi.SubItems.Add(m.Result.ToString());
lvi.SubItems.Add(m.WParam.ToString());
e.Result = lvi;
}
Comment