コード例 #1
0
    public static DWM_TIMING_INFO?DwmGetCompositionTimingInfo(IntPtr hwnd)
    {
        if (!Utility.IsOSVistaOrNewer)
        {
            return(null);
        }
        DWM_TIMING_INFO value = new DWM_TIMING_INFO
        {
            cbSize = Marshal.SizeOf(typeof(DWM_TIMING_INFO))
        };
        HRESULT hrLeft = NativeMethods._DwmGetCompositionTimingInfo(hwnd, ref value);

        if (hrLeft == HRESULT.E_PENDING)
        {
            return(null);
        }
        hrLeft.ThrowIfFailed();
        return(new DWM_TIMING_INFO?(value));
    }
コード例 #2
0
ファイル: NativeMethods.cs プロジェクト: Egaros/lib
        public static DWM_TIMING_INFO?DwmGetCompositionTimingInfo(IntPtr hwnd)
        {
            if (!PlatformUtil.IsOSVistaOrNewer)
            {
                // API was new to Vista.
                return(null);
            }

            var dti = new DWM_TIMING_INFO {
                cbSize = Marshal.SizeOf(typeof(DWM_TIMING_INFO))
            };

            var hr = _DwmGetCompositionTimingInfo(hwnd, ref dti);

            if (hr == HRESULT.E_PENDING)
            {
                return(null);
            }

            hr.ThrowIfFailed();

            return(dti);
        }
コード例 #3
0
 public static extern int DwmGetCompositionTimingInfo(IntPtr hwnd, out DWM_TIMING_INFO pTimingInfo);
コード例 #4
0
        /// <summary>
        /// Retrieves the current composition timing information.
        /// </summary>
        /// <param name="hwnd">The handle to the window for which the composition timing information should be retrieved.</param>
        /// <returns>A pointer to a DWM_TIMING_INFO structure that, when this function returns successfully, receives the current composition timing information for the window. </returns>
        public static DWM_TIMING_INFO? DwmGetCompositionTimingInfo(IntPtr hwnd)
        {
            if (Environment.OSVersion.Version < new Version("6.0"))
            {
                // API was new to Vista.
                return null;
            }

            var dti = new DWM_TIMING_INFO { cbSize = Marshal.SizeOf(typeof(DWM_TIMING_INFO)) };
            DwmGetCompositionTimingInfo(hwnd, ref dti);

            return dti;
        }
コード例 #5
0
 private static extern IntPtr DwmGetCompositionTimingInfo(IntPtr hwnd, ref DWM_TIMING_INFO pTimingInfo);
コード例 #6
0
ファイル: AeroForm.cs プロジェクト: fthmko/myCode
 public static extern int DwmGetCompositionTimingInfo(IntPtr hwnd, ref DWM_TIMING_INFO pTimingInfo);
コード例 #7
0
 private static extern HRESULT _DwmGetCompositionTimingInfo(IntPtr hwnd, ref DWM_TIMING_INFO pTimingInfo);