GetWindowLong() private method

private GetWindowLong ( IntPtr hWnd, int nIndex ) : uint
hWnd System.IntPtr
nIndex 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 ) );
            }
        }
Ejemplo n.º 2
0
 public WindowStylesHelper(IntPtr handle)
 {
     WinStyle   = PI.GetWindowLong(handle, PI.GWL_.STYLE);
     WinExStyle = PI.GetWindowLong(handle, PI.GWL_.EXSTYLE);
 }