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)); }
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); }
public static extern int DwmGetCompositionTimingInfo(IntPtr hwnd, out DWM_TIMING_INFO pTimingInfo);
/// <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; }
private static extern IntPtr DwmGetCompositionTimingInfo(IntPtr hwnd, ref DWM_TIMING_INFO pTimingInfo);
public static extern int DwmGetCompositionTimingInfo(IntPtr hwnd, ref DWM_TIMING_INFO pTimingInfo);
private static extern HRESULT _DwmGetCompositionTimingInfo(IntPtr hwnd, ref DWM_TIMING_INFO pTimingInfo);