/// <summary> /// Places the given window in the system-maintained clipboard format listener list /// </summary> /// <param name="hwnd">Handle to the window to place in the clipboard format listener list</param> /// <returns>Returns true if successful, false otherwise</returns> public static bool AddClipboardFormatListener([In] IntPtr hwnd) { var hostVersion = new OperatingSystemVersion(); if (hostVersion.OSVersion == OSVersion.Vista) { return Native.AddClipboardFormatListener(hwnd); } throw new PlatformNotSupportedException("Windows platform not supported.\nVista or higher is required"); }
/// <summary> /// Places the given window in the system-maintained clipboard format listener list /// </summary> /// <param name="hwnd">Handle to the window to place in the clipboard format listener list</param> /// <returns>Returns true if successful, false otherwise</returns> public static bool AddClipboardFormatListener([In] IntPtr hwnd) { var hostVersion = new OperatingSystemVersion(); if (hostVersion.OSVersion == OSVersion.Vista) { return(Native.AddClipboardFormatListener(hwnd)); } throw new PlatformNotSupportedException("Windows platform not supported.\nVista or higher is required"); }
/// <summary> /// Retrieves the currently supported Clipboard formats /// </summary> /// <param name="lpuiFormats">When this function returns, contains a pointer to an array of ClipboardFormat /// that identify clipboard formats</param> /// <param name="cFormats">Specifies the number of entries in the array pointed to by lpuiFormats</param> /// <param name="pcFormatsOut">When this function returns, contains a pointer to the actual number of clipboard /// formats in the array pointed to by lpuiFormats.</param> /// <returns>Returns true if successful; otherwise, false</returns> public static bool GetUpdatedClipboardFormats([Out] out IntPtr lpuiFormats, [In] uint cFormats, [Out] out IntPtr pcFormatsOut) { var hostVersion = new OperatingSystemVersion(); if (hostVersion.OSVersion == OSVersion.Vista) { return(Native.GetUpdatedClipboardFormats(out lpuiFormats, cFormats, out pcFormatsOut)); } throw new PlatformNotSupportedException("Windows platform not supported.\nVista or higher is required"); }
/// <summary> /// Retrieves the currently supported Clipboard formats /// </summary> /// <param name="lpuiFormats">When this function returns, contains a pointer to an array of ClipboardFormat /// that identify clipboard formats</param> /// <param name="cFormats">Specifies the number of entries in the array pointed to by lpuiFormats</param> /// <param name="pcFormatsOut">When this function returns, contains a pointer to the actual number of clipboard /// formats in the array pointed to by lpuiFormats.</param> /// <returns>Returns true if successful; otherwise, false</returns> public static bool GetUpdatedClipboardFormats([Out] out IntPtr lpuiFormats, [In] uint cFormats, [Out] out IntPtr pcFormatsOut) { var hostVersion = new OperatingSystemVersion(); if (hostVersion.OSVersion == OSVersion.Vista) { return Native.GetUpdatedClipboardFormats(out lpuiFormats, cFormats, out pcFormatsOut); } throw new PlatformNotSupportedException("Windows platform not supported.\nVista or higher is required"); }