protected override void WndProc(ref Message m) { switch (m.Msg) { case 0x7b: //WM_CONTEXTMENU { int lp = m.LParam.ToInt32(); Point pt = new Point(((lp << 16) >> 16), lp >> 16); IntPtr hHdr = HeaderHandle; if (0 != NativeMethods.MapWindowPoints(IntPtr.Zero, hHdr, ref pt, 1)) { var hti = new NativeMethods.HDHITTESTINFO(pt); int item = NativeMethods.SendMessage(hHdr, NativeMethods.HeaderMessage.HitTest, 0, hti).ToInt32(); if (item != -1) { if (ColumnContextMenuStrip != null) { ColumnContextMenuStrip.Show(pt); } } } } break; case 0x204E: // WM_NOTIFY WmReflectNotify(ref m); break; case 0x0200: // WM_MOUSEMOVE return; case 0x0202: // WM_LBUTTONUP default: break; } base.WndProc(ref m); }