Platforms to show: All Mac Windows Linux Cross-Platform
WindowsClipboardMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Windows | MBS Win Plugin | 10.4 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Use it to access the clipboard on Windows.
Be aware that in the constructor we open the clipboard connection. Since Xojo may itself like to look into the clipboard to decide whether to enable copy & paste events, our clipboard connection may get taken or times out. Only one app at a time can have clipboard access.
- property Valid as Boolean
- 14 methods
- method Clear
- method ClipboardFormats as Integer()
- method Constructor
- method CountClipboardFormats as Integer
- method Destructor
- method EnumClipboardFormats(format as Integer = 0) as Integer
- method GetData(type as Integer) as string
- method GetDIB as Picture
- method GetFiles as string()
- method GetPicture as Picture
- method SetData(type as Integer, rawData as string) as boolean
- method SetDIB(pic as Picture) as boolean
- method SetFiles(paths() as string) as boolean
- method SetPicture(pic as Picture) as boolean
- 4 shared methods
- shared method ClipboardSequenceNumber as Integer
- shared method GetClipboardFormatName(format as Integer) as string
- shared method IsClipboardFormatAvailable(type as Integer) as boolean
- shared method RegisterClipboardFormat(type as string) as Integer
- 17 constants
Constants
Constant | Value | Description |
---|---|---|
kTypeBitmap | 2 |
One of standard clipboard formats defined by the system.
A handle to a bitmap (HBITMAP). |
kTypeDIB | 8 |
One of standard clipboard formats defined by the system.
A memory object containing a BITMAPINFO structure followed by the bitmap bits. |
kTypeDIBV5 | 17 |
One of standard clipboard formats defined by the system.
A memory object containing a BITMAPV5HEADER structure followed by the bitmap color space information and the bitmap bits. |
kTypeDIF | 5 |
One of standard clipboard formats defined by the system.
Software Arts' Data Interchange Format. |
kTypeENHMetaFile | 14 |
One of standard clipboard formats defined by the system.
A handle to an enhanced metafile (HENHMETAFILE). |
kTypeHDROP | 15 |
One of standard clipboard formats defined by the system.
A handle to type HDROP that identifies a list of files. An application can retrieve information about the files by passing the handle to the DragQueryFile function. |
kTypeLocale | 16 | One of standard clipboard formats defined by the system. The data is a handle to the locale identifier associated with text in the clipboard. When you close the clipboard, if it contains kTypeText data but no kTypeLocale data, the system automatically sets the kTypeLocale format to the current input language. You can use the kTypeLocale format to associate a different locale with the clipboard text. more |
kTypeMetaFilePict | 3 |
One of standard clipboard formats defined by the system.
Handle to a metafile picture format as defined by the METAFILEPICT structure. When passing a kTypeMetaFilePict handle by means of DDE, the application responsible for deleting hMem should also free the metafile referred to by the kTypeMetaFilePict handle. |
kTypeOEMText | 7 |
One of standard clipboard formats defined by the system.
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. |
kTypePalette | 9 | One of standard clipboard formats defined by the system. Handle to a color palette. Whenever an application places data in the clipboard that depends on or assumes a color palette, it should place the palette on the clipboard as well. more |
kTypePenData | 10 |
One of standard clipboard formats defined by the system.
Data for the pen extensions to the Microsoft Windows for Pen Computing |
kTypeRIFF | 11 |
One of standard clipboard formats defined by the system.
Represents audio data more complex than can be represented in a CF_WAVE standard wave format. |
kTypeSylk | 4 |
One of standard clipboard formats defined by the system.
Microsoft Symbolic Link (SYLK) format. |
kTypeText | 1 |
One of standard clipboard formats defined by the system.
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. |
kTypeTIFF | 6 |
One of standard clipboard formats defined by the system.
Tagged-image file format. |
kTypeUnicodeText | 13 |
One of standard clipboard formats defined by the system.
Unicode text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. |
kTypeWAVE | 12 |
One of standard clipboard formats defined by the system.
Represents audio data in one of the standard wave formats, such as 11 kHz or 22 kHz PCM. |
This class has no sub classes.
Blog Entries
- MBS Xojo Plugins, version 25.2pr1
- MonkeyBread Software Releases the MBS Xojo Plugins in version 17.4
- MBS Xojo Plugins, version 17.4pr5
- MBS Xojo Plugins, version 17.4pr3
- Windows, Xojo and the Clipboard
- MBS Xojo / Real Studio Plugins, version 16.5pr4
- [ANN] MonkeyBread Software Releases the MBS Xojo / Real Studio plug-ins in version 14.4
- New MBS REALbasic Plugin Version 10.4
- MBS REALbasic Plugins Version 10.4 release notes
- Teaser: Clipboard classes
Xojo Developer Magazine
Videos
Release notes
- Version 25.2
- Fixed a problem with an integer overflow in RegisterClipboardFormat function in WindowsClipboardMBS class.
- Version 17.4
- Added GetDIB and SetDIB to WindowsClipboardMBS class to better get/set pictures on clipboard.
- Fixed crash with WindowsClipboardMBS and Xojo 2015, introduced in pr3.
Some examples using this class:
- /MacCocoa/ClipboardSaver
- /Win/Clipboard/Clipboard Files
- /Win/Clipboard/ClipboardSaver
- /Win/Clipboard/Picture on Clipboard
The items on this page are in the following plugins: MBS Win Plugin.
WindowsBurnMBS - WindowsCompressorMBS
