IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam)
{
Message m = new Message()
{
HWnd = hWnd,
Msg = msg,
WParam = wParam,
LParam = lParam,
};
MessageProc proc;
if (procs.TryGetValue(msg, out proc) && proc != null)
{
proc(ref m);
}
else
{
CallBaseWindowProc(ref m);
}
return m.Result;
}