private void DrawSplitHelper(int splitSize)
 {
     if (this.splitTarget != null)
     {
         Rectangle rectangle = this.CalcSplitLine(splitSize, 3);
         IntPtr    handle    = this.ParentInternal.Handle;
         IntPtr    ptr2      = System.Windows.Forms.UnsafeNativeMethods.GetDCEx(new HandleRef(this.ParentInternal, handle), System.Windows.Forms.NativeMethods.NullHandleRef, 0x402);
         IntPtr    ptr3      = ControlPaint.CreateHalftoneHBRUSH();
         IntPtr    ptr4      = System.Windows.Forms.SafeNativeMethods.SelectObject(new HandleRef(this.ParentInternal, ptr2), new HandleRef(null, ptr3));
         System.Windows.Forms.SafeNativeMethods.PatBlt(new HandleRef(this.ParentInternal, ptr2), rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, 0x5a0049);
         System.Windows.Forms.SafeNativeMethods.SelectObject(new HandleRef(this.ParentInternal, ptr2), new HandleRef(null, ptr4));
         System.Windows.Forms.SafeNativeMethods.DeleteObject(new HandleRef(null, ptr3));
         System.Windows.Forms.UnsafeNativeMethods.ReleaseDC(new HandleRef(this.ParentInternal, handle), new HandleRef(null, ptr2));
     }
 }
Example #2
0
        /// <include file='doc\Splitter.uex' path='docs/doc[@for="Splitter.DrawSplitHelper"]/*' />
        /// <devdoc>
        ///     Draws the splitter line at the requested location. Should only be called
        ///     by drawSpltBar.
        /// </devdoc>
        /// <internalonly/>
        private void DrawSplitHelper(int splitSize)
        {
            if (splitTarget == null)
            {
                return;
            }

            Rectangle r            = CalcSplitLine(splitSize, 3);
            IntPtr    parentHandle = ParentInternal.Handle;
            IntPtr    dc           = UnsafeNativeMethods.GetDCEx(new HandleRef(ParentInternal, parentHandle), NativeMethods.NullHandleRef, NativeMethods.DCX_CACHE | NativeMethods.DCX_LOCKWINDOWUPDATE);
            IntPtr    halftone     = ControlPaint.CreateHalftoneHBRUSH();
            IntPtr    saveBrush    = SafeNativeMethods.SelectObject(new HandleRef(ParentInternal, dc), new HandleRef(null, halftone));

            SafeNativeMethods.PatBlt(new HandleRef(ParentInternal, dc), r.X, r.Y, r.Width, r.Height, NativeMethods.PATINVERT);
            SafeNativeMethods.SelectObject(new HandleRef(ParentInternal, dc), new HandleRef(null, saveBrush));
            SafeNativeMethods.DeleteObject(new HandleRef(null, halftone));
            UnsafeNativeMethods.ReleaseDC(new HandleRef(ParentInternal, parentHandle), new HandleRef(null, dc));
        }