SetWindowLong() private method

private SetWindowLong ( IntPtr hwnd, int nIndex, int nLong ) : uint
hwnd System.IntPtr
nIndex int
nLong int
return uint
        //

        static void Update(Control control, bool enable)
        {
            if (control.Parent != null)
            {
                Update(control.Parent, enable);
            }

            if (control is IDoubleBufferComposited)
            {
                int style = PI.GetWindowLong(control.Handle, PI.GWL_EXSTYLE);

                int newStyle;
                if (enable)
                {
                    newStyle = style | PI.WS_EX_COMPOSITED;
                }
                else
                {
                    newStyle = style & ~PI.WS_EX_COMPOSITED;
                }

                if (newStyle != style)
                {
                    PI.SetWindowLong(control.Handle, PI.GWL_EXSTYLE, (IntPtr)newStyle);
                }

                //if( enable )
                //    PI.SetWindowLong( control.Handle, PI.GWL_EXSTYLE, (IntPtr)( style | PI.WS_EX_COMPOSITED ) );
                //else
                //    PI.SetWindowLong( control.Handle, PI.GWL_EXSTYLE, (IntPtr)( style & ~PI.WS_EX_COMPOSITED ) );
            }
        }