protected override void WndProc(ref Message m)
{
/* If visual theme is changed we have to reinitialize drawing mode to prevent exception being
* thrown by TabRenderer when switching from visual styles to "Windows Classic" and vise versa.*/
if (m.Msg == NativeMethods.WM_THEMECHANGED) InitializeDrawMode();
else if (m.Msg == NativeMethods.WM_PARENTNOTIFY && (m.WParam.ToInt32() & 0xffff) == NativeMethods.WM_CREATE)
{
/* Tab scroller has created(too many tabs to display and tab control is not multiline), so
* let's attach our hook to it.*/
StringBuilder className = new StringBuilder(16);
if (NativeMethods.RealGetWindowClass(m.LParam, className, 16) > 0 &&
className.ToString() == "msctls_updown32")
{
fUpDown.ReleaseHandle();
fUpDown.AssignHandle(m.LParam);
}
}
base.WndProc(ref m);
}