GetWindowLong() 개인적인 메소드

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