From e693b4b11e24169f956413a420114da4396b23bf Mon Sep 17 00:00:00 2001 From: dahall Date: Tue, 17 Aug 2021 11:07:23 -0600 Subject: [PATCH] Added CorrespondingType attributes to StandardClipboardFormat values. --- PInvoke/User32/WinUser.Clipboard.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PInvoke/User32/WinUser.Clipboard.cs b/PInvoke/User32/WinUser.Clipboard.cs index b0ffea4c..545f7c95 100644 --- a/PInvoke/User32/WinUser.Clipboard.cs +++ b/PInvoke/User32/WinUser.Clipboard.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; +using System.IO; using System.Runtime.InteropServices; using System.Text; +using Vanara.InteropServices; namespace Vanara.PInvoke { @@ -219,14 +221,17 @@ namespace Vanara.PInvoke public enum StandardClipboardFormat : uint { /// A handle to a bitmap (HBITMAP). + [CorrespondingType(typeof(HBITMAP))] CF_BITMAP = 2, /// A memory object containing a BITMAPINFO structure followed by the bitmap bits. + [CorrespondingType(typeof(Gdi32.SafeBITMAPINFO))] CF_DIB = 8, /// /// A memory object containing a BITMAPV5HEADER structure followed by the bitmap color space information and the bitmap bits. /// + //[CorrespondingType(typeof(Gdi32.SafeBITMAPV5HEADER))] CF_DIBV5 = 17, /// Software Arts' Data Interchange Format. @@ -236,27 +241,32 @@ namespace Vanara.PInvoke /// Bitmap display format associated with a private format. The hMem parameter must be a handle to data that can be displayed in /// bitmap format in lieu of the privately formatted data. /// + [CorrespondingType(typeof(HBITMAP))] CF_DSPBITMAP = 0x0082, /// /// Enhanced metafile display format associated with a private format. The hMem parameter must be a handle to data that can be /// displayed in enhanced metafile format in lieu of the privately formatted data. /// + [CorrespondingType(typeof(HENHMETAFILE))] CF_DSPENHMETAFILE = 0x008E, /// /// Metafile-picture display format associated with a private format. The hMem parameter must be a handle to data that can be /// displayed in metafile-picture format in lieu of the privately formatted data. /// + [CorrespondingType(typeof(SafeMemStruct))] CF_DSPMETAFILEPICT = 0x0083, /// /// Text display format associated with a private format. The hMem parameter must be a handle to data that can be displayed in /// text format in lieu of the privately formatted data. /// + [CorrespondingType(typeof(SafeMemString), EncodingType = typeof(UTF8Encoding))] CF_DSPTEXT = 0x0081, /// A handle to an enhanced metafile (HENHMETAFILE). + [CorrespondingType(typeof(HENHMETAFILE))] CF_ENHMETAFILE = 14, /// @@ -267,6 +277,7 @@ namespace Vanara.PInvoke /// handle allocated by the GlobalAlloc function with the GMEM_MOVEABLE flag. /// /// + [CorrespondingType(typeof(Stream))] CF_GDIOBJFIRST = 0x0300, /// See CF_GDIOBJFIRST. @@ -295,18 +306,21 @@ namespace Vanara.PInvoke /// correct code page table is used for the conversion. /// /// + [CorrespondingType(typeof(SafeMemStruct))] CF_LOCALE = 16, /// /// Handle to a metafile picture format as defined by the METAFILEPICT structure. When passing a CF_METAFILEPICT handle by means /// of DDE, the application responsible for deleting hMem should also free the metafile referred to by the CF_METAFILEPICT handle. /// + [CorrespondingType(typeof(SafeMemStruct))] CF_METAFILEPICT = 3, /// /// Text format containing characters in the OEM character set. Each line ends with a carriage return/linefeed (CR-LF) /// combination. A null character signals the end of the data. /// + [CorrespondingType(typeof(SafeMemString), EncodingType = typeof(UTF8Encoding))] CF_OEMTEXT = 7, /// @@ -328,6 +342,7 @@ namespace Vanara.PInvoke /// CF_PALETTE format. /// /// + [CorrespondingType(typeof(HPALETTE))] CF_PALETTE = 9, /// Data for the pen extensions to the Microsoft Windows for Pen Computing. @@ -344,6 +359,7 @@ namespace Vanara.PInvoke CF_PRIVATELAST = 0x02FF, /// Represents audio data more complex than can be represented in a CF_WAVE standard wave format. + [CorrespondingType(typeof(Stream))] CF_RIFF = 11, /// Microsoft Symbolic Link (SYLK) format. @@ -353,18 +369,22 @@ namespace Vanara.PInvoke /// Text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the /// data. Use this format for ANSI text. /// + [CorrespondingType(typeof(SafeMemString), EncodingType = typeof(UTF8Encoding))] CF_TEXT = 1, /// Tagged-image file format. + [CorrespondingType(typeof(Stream))] CF_TIFF = 6, /// /// Unicode text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of /// the data. /// + [CorrespondingType(typeof(SafeMemString), EncodingType = typeof(UnicodeEncoding))] CF_UNICODETEXT = 13, /// Represents audio data in one of the standard wave formats, such as 11 kHz or 22 kHz PCM. + [CorrespondingType(typeof(Stream))] CF_WAVE = 12, }