コード例 #1
0
        /// <summary>
        /// Creates a DC as SafeWindowDcHandle for the client area of the specified hWnd
        /// </summary>
        /// <param name="hWnd">IntPtr</param>
        /// <returns>SafeWindowDcHandle</returns>
        public static SafeWindowDcHandle FromWindowClientArea(IntPtr hWnd)
        {
            var hDcDesktop = User32Api.GetWindowDC(hWnd);

            return(new SafeWindowDcHandle(hWnd, hDcDesktop));
        }