// 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 ) ); } }
public WindowStylesHelper(IntPtr handle) { WinStyle = PI.GetWindowLong(handle, PI.GWL_.STYLE); WinExStyle = PI.GetWindowLong(handle, PI.GWL_.EXSTYLE); }