IntPtr CtrlWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam) { if (!m_WndProcMap.ContainsKey(hWnd)) { return(m_DefWndProcDelegate(hWnd, msg, wParam, lParam)); } IntPtr nRet = NativeMethods.CallWindowProc(m_WndProcMap[hWnd], hWnd, msg, wParam, lParam); switch (msg) { case (uint)WindowsMessage.WM_PAINT: case (uint)WindowsMessage.WM_CTLCOLOREDIT: case (uint)WindowsMessage.WM_CTLCOLORBTN: case (uint)WindowsMessage.WM_CTLCOLORSTATIC: case (uint)WindowsMessage.WM_CTLCOLORMSGBOX: case (uint)WindowsMessage.WM_CTLCOLORDLG: case (uint)WindowsMessage.WM_CTLCOLORLISTBOX: case (uint)WindowsMessage.WM_CTLCOLORSCROLLBAR: case (uint)WindowsMessage.WM_CAPTURECHANGED: RefreshFakeWnd(); break; default: break; } return(nRet); }