コード例 #1
0
ファイル: DpiUtil.cs プロジェクト: beda2280/wpf-1
        /// <summary>
        /// Equivalent to <see cref="GetProcessDpiAwareness(IntPtr)"/>
        /// </summary>
        /// <param name="hWnd">Handle to the window being queried</param>
        /// <returns>The <see cref="DpiAwarenessContextValue"/> enum corresponding to the PROCESS_DPI_AWARENESS value of the <paramref name="hWnd"/></returns>
        /// <remarks>See remarks for <see cref="GetProcessDpiAwareness(IntPtr)"/></remarks>
        internal static DpiAwarenessContextValue GetProcessDpiAwarenessContextValue(IntPtr hWnd)
        {
            var dpiAwarenessContext = ProcessDpiAwarenessHelper.GetProcessDpiAwareness(hWnd);

            return((DpiAwarenessContextValue)DpiAwarenessContextHelper.GetProcessDpiAwarenessContext(dpiAwarenessContext));
        }
コード例 #2
0
ファイル: DpiUtil.cs プロジェクト: beda2280/wpf-1
 /// <summary>
 /// Gets the DPI awareness context handle from and HWND
 /// </summary>
 /// <param name="hWnd">Handle to the window</param>
 /// <returns>The awareness context</returns>
 /// <remarks>
 ///     .. Attempts to get the value directly from the HWND, failing which
 ///     .. attempts to get it from the PROCESS_DPI_AWARENESS
 ///             value associated with the process of the HWND, failing which
 ///     .. gets the value from the PROCESS_DPI_AWARENESS of
 ///             the currently executing process
 /// </remarks>
 internal static DpiAwarenessContextHandle GetDpiAwarenessContext(IntPtr hWnd)
 {
     return(DpiAwarenessContextHelper.GetDpiAwarenessContext(hWnd));
 }