private void ExtendClientArea()
        {
            // This native method extends non-client area. If you want to draw on whole window,
            // search for tutorial about it on CodeProject, that involves handling WM_NCCALCSIZE.
            var margin = new NativeMargin(0, 64, 0, 0);

            NativeMethods.DwmExtendFrameIntoClientArea(this.Handle, ref margin);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Extends a windows frame into the client area of the window.
        /// </summary>
        /// <param name="hwnd">A IntPtr representing the handle of a window.</param>
        public static void ExtendFrameIntoClientArea(IntPtr hwnd)
        {
            var margin = new NativeMargin
            {
                cxLeftWidth    = -1,
                cxRightWidth   = -1,
                cyBottomHeight = -1,
                cyTopHeight    = -1
            };

            DwmApi.DwmExtendFrameIntoClientArea(hwnd, ref margin);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Extends the frame into client area.
        /// </summary>
        private void ExtendFrameIntoClientArea()
        {
            if (!IsInitialized)
            {
                throw new InvalidOperationException("The window has not been initialized!");
            }

            var margin = new NativeMargin
            {
                cxLeftWidth    = -1,
                cxRightWidth   = -1,
                cyBottomHeight = -1,
                cyTopHeight    = -1
            };

            DwmApi.DwmExtendFrameIntoClientArea(WindowHandle, ref margin);
        }